Skip to content

Commit 589b4b6

Browse files
fix: types for startDate and endDate props (#5259)
1 parent 4ce96a0 commit 589b4b6

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

src/day.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ interface DayProps
3939
disabledKeyboardNavigation?: boolean;
4040
day: Date;
4141
dayClassName?: (date: Date) => string;
42-
endDate?: Date;
4342
highlightDates?: Map<string, string[]>;
4443
holidays?: HolidaysMap;
4544
inline?: boolean;
@@ -60,7 +59,8 @@ interface DayProps
6059
selectsDisabledDaysInRange?: boolean;
6160
selectsMultiple?: boolean;
6261
selectedDates?: Date[];
63-
startDate?: Date;
62+
startDate?: Date | null;
63+
endDate?: Date | null;
6464
renderDayContents?: (day: number, date: Date) => React.ReactNode;
6565
containerRef?: React.RefObject<HTMLDivElement>;
6666
calendarStartDay?: DateNumberType;

src/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,8 @@ export type DatePickerProps = OmitUnion<
176176
calendarIconClassName?: string;
177177
toggleCalendarOnIconClick?: boolean;
178178
holidays?: Holiday[];
179-
startDate?: Date;
179+
startDate?: Date | null;
180+
endDate?: Date | null;
180181
selected?: Date | null;
181182
value?: string;
182183
customInputRef?: string;

src/month.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,8 @@ interface MonthProps
124124
handleOnMonthKeyDown?: (event: React.KeyboardEvent<HTMLDivElement>) => void;
125125
ariaLabelPrefix?: string;
126126
day: Date;
127+
startDate?: Date | null;
128+
endDate?: Date | null;
127129
orderInDisplay?: number;
128130
fixedHeight?: boolean;
129131
peekNextMonth?: boolean;

src/year.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ interface YearProps
3030
clearSelectingDate?: VoidFunction;
3131
date?: Date;
3232
disabledKeyboardNavigation?: boolean;
33-
endDate?: Date;
3433
onDayClick?: (
3534
date: Date,
3635
event:
@@ -55,7 +54,8 @@ interface YearProps
5554
selectsEnd?: boolean;
5655
selectsStart?: boolean;
5756
selectsRange?: boolean;
58-
startDate?: Date;
57+
startDate?: Date | null;
58+
endDate?: Date | null;
5959
yearItemNumber?: number;
6060
handleOnKeyDown?: React.KeyboardEventHandler<HTMLDivElement>;
6161
yearClassName?: (date: Date) => string;

0 commit comments

Comments
 (0)