Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions docs/examples/debug.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,10 @@ export default () => {
// dayjs('2000-01-09'),
]}
// disabledDate={(date) => date.date() >= 5}
getPopupContainer={(node) => {
console.log('Popup!', node);
return node.parentElement!;
}}
presets={[
{
label: 'Good',
Expand Down Expand Up @@ -192,6 +196,7 @@ export default () => {
<RangePicker
{...sharedLocale}
value={rangeValue}
separator="~~~~~"
showTime={{
defaultValue: [dayjs('2000-01-01 01:02:03'), dayjs('2000-01-01 05:06:07')],
}}
Expand Down
4 changes: 3 additions & 1 deletion src/PickerInput/RangePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,15 @@ function separateConfig<T>(config: T | [T, T] | null | undefined, defaultConfig:
return [singleConfig, singleConfig];
}

export type RangeValueType<DateType> = [start?: DateType, end?: DateType];
export type RangeValueType<DateType> = [start?: DateType | null, end?: DateType | null];

export interface BaseRangePickerProps<DateType extends object>
extends Omit<SharedPickerProps<DateType>, 'showTime' | 'id'> {
// Structure
id?: SelectorIdType;

separator?: React.ReactNode;

// Value
value?: RangeValueType<DateType>;
defaultValue?: RangeValueType<DateType>;
Expand Down