File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change 23
23
- ✅ Shortcuts
24
24
- ✅ TypeScript support
25
25
- ✅ Localization(i18n)
26
+ - ✅ Date formatting
26
27
- ⬜ Disable specific dates
27
28
- ⬜ Custom shortcuts
28
29
Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ interface Props {
46
46
disabled ?: boolean ;
47
47
inputClassName ?: string | null ;
48
48
containerClassName ?: string | null ;
49
+ displayFormat ?: string ;
49
50
readonly ?: boolean ;
50
51
}
51
52
@@ -65,6 +66,7 @@ const Datepicker: React.FC<Props> = ({
65
66
disabled = false ,
66
67
inputClassName = null ,
67
68
containerClassName = null ,
69
+ displayFormat = "YYYY-MM-DD" ,
68
70
readonly = false
69
71
} ) => {
70
72
// Ref
@@ -216,7 +218,9 @@ const Datepicker: React.FC<Props> = ({
216
218
end : formatDate ( endDate )
217
219
} ) ;
218
220
setInputText (
219
- `${ formatDate ( startDate ) } ${ asSingle ? "" : ` ~ ${ formatDate ( endDate ) } ` } `
221
+ `${ formatDate ( startDate , displayFormat ) } ${
222
+ asSingle ? "" : ` ~ ${ formatDate ( endDate , displayFormat ) } `
223
+ } `
220
224
) ;
221
225
}
222
226
}
@@ -227,7 +231,7 @@ const Datepicker: React.FC<Props> = ({
227
231
end : null
228
232
} ) ;
229
233
}
230
- } , [ asSingle , value ] ) ;
234
+ } , [ asSingle , value , displayFormat ] ) ;
231
235
232
236
// Variable
233
237
const colorPrimary = useMemo ( ( ) => {
You can’t perform that action at this time.
0 commit comments