File tree Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -14,10 +14,10 @@ import DatepickerContext from "../contexts/DatepickerContext";
1414interface Props {
1515 primaryColor ?: string ,
1616 value : {
17- startDate : string | Date ,
18- endDate : string | Date
17+ startDate : string | Date | null ,
18+ endDate : string | Date | null
1919 } | null ,
20- onChange : ( value : { startDate : string | Date , endDate : string | Date } | null ) => void ,
20+ onChange : ( value : { startDate : string | Date | null , endDate : string | Date | null } | null ) => void ,
2121 useRange ?: boolean ,
2222 showFooter ?: boolean ,
2323 showShortcuts ?: boolean ,
Original file line number Diff line number Diff line change @@ -2,6 +2,11 @@ import React, {createContext} from "react";
22import dayjs from "dayjs" ;
33import { Configs , Period } from "../types" ;
44
5+ type DateRange = {
6+ startDate : string | Date | null ,
7+ endDate : string | Date | null ,
8+ } | null ;
9+
510interface DatepickerStore {
611 asSingle ?: boolean ,
712 primaryColor : string ,
@@ -15,15 +20,12 @@ interface DatepickerStore {
1520 inputText : string ,
1621 changeInputText : ( text : string ) => void ,
1722 updateFirstDate : ( date : dayjs . Dayjs ) => void ,
18- changeDatepickerValue : ( value : { startDate : string | Date , endDate : string | Date } | null ) => void ,
23+ changeDatepickerValue : ( value : DateRange ) => void ,
1924 showFooter ?: boolean ,
2025 placeholder ?: string | null ,
2126 separator ?: string ,
2227 i18n : string ,
23- value : {
24- startDate : Date | string ,
25- endDate : Date | string ,
26- } | null
28+ value : DateRange
2729}
2830
2931const DatepickerContext = createContext < DatepickerStore > ( {
You can’t perform that action at this time.
0 commit comments