File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed 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
}
50
51
51
52
const Datepicker : React . FC < Props > = ( {
@@ -63,7 +64,8 @@ const Datepicker: React.FC<Props> = ({
63
64
i18n = "en" ,
64
65
disabled = false ,
65
66
inputClassName = null ,
66
- containerClassName = null
67
+ containerClassName = null ,
68
+ displayFormat = "YYYY-MM-DD"
67
69
} ) => {
68
70
// Ref
69
71
const containerRef = useRef < HTMLDivElement > ( null ) ;
@@ -214,7 +216,9 @@ const Datepicker: React.FC<Props> = ({
214
216
end : formatDate ( endDate )
215
217
} ) ;
216
218
setInputText (
217
- `${ formatDate ( startDate ) } ${ asSingle ? "" : ` ~ ${ formatDate ( endDate ) } ` } `
219
+ `${ formatDate ( startDate , displayFormat ) } ${
220
+ asSingle ? "" : ` ~ ${ formatDate ( endDate , displayFormat ) } `
221
+ } `
218
222
) ;
219
223
}
220
224
}
@@ -225,7 +229,7 @@ const Datepicker: React.FC<Props> = ({
225
229
end : null
226
230
} ) ;
227
231
}
228
- } , [ asSingle , value ] ) ;
232
+ } , [ asSingle , value , displayFormat ] ) ;
229
233
230
234
// Variable
231
235
const colorPrimary = useMemo ( ( ) => {
You can’t perform that action at this time.
0 commit comments