Skip to content

Commit 3d07c29

Browse files
committed
fix to use getToday func if date is not passed
1 parent 8dea0c2 commit 3d07c29

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/scripts/Datepicker.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ type Calendar = {
5050
function createCalendarObject(date?: string, mnDate?: string, mxDate?: string) {
5151
let minDate;
5252
let maxDate;
53-
let d = dayjs(date, 'YYYY-MM-DD');
53+
let d = dayjs(date ?? null, 'YYYY-MM-DD');
5454
if (!d.isValid()) {
5555
d = dayjs(getToday(), 'YYYY-MM-DD');
5656
}

0 commit comments

Comments
 (0)