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";
14
14
interface Props {
15
15
primaryColor ?: string ,
16
16
value : {
17
- startDate : string | Date ,
18
- endDate : string | Date
17
+ startDate : string | Date | null ,
18
+ endDate : string | Date | null
19
19
} | 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 ,
21
21
useRange ?: boolean ,
22
22
showFooter ?: boolean ,
23
23
showShortcuts ?: boolean ,
Original file line number Diff line number Diff line change @@ -2,6 +2,11 @@ import React, {createContext} from "react";
2
2
import dayjs from "dayjs" ;
3
3
import { Configs , Period } from "../types" ;
4
4
5
+ type DateRange = {
6
+ startDate : string | Date | null ,
7
+ endDate : string | Date | null ,
8
+ } | null ;
9
+
5
10
interface DatepickerStore {
6
11
asSingle ?: boolean ,
7
12
primaryColor : string ,
@@ -15,15 +20,12 @@ interface DatepickerStore {
15
20
inputText : string ,
16
21
changeInputText : ( text : string ) => void ,
17
22
updateFirstDate : ( date : dayjs . Dayjs ) => void ,
18
- changeDatepickerValue : ( value : { startDate : string | Date , endDate : string | Date } | null ) => void ,
23
+ changeDatepickerValue : ( value : DateRange ) => void ,
19
24
showFooter ?: boolean ,
20
25
placeholder ?: string | null ,
21
26
separator ?: string ,
22
27
i18n : string ,
23
- value : {
24
- startDate : Date | string ,
25
- endDate : Date | string ,
26
- } | null
28
+ value : DateRange
27
29
}
28
30
29
31
const DatepickerContext = createContext < DatepickerStore > ( {
You can’t perform that action at this time.
0 commit comments