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 {
4646 disabled ?: boolean ;
4747 inputClassName ?: string | null ;
4848 containerClassName ?: string | null ;
49+ displayFormat ?: string ;
4950}
5051
5152const Datepicker : React . FC < Props > = ( {
@@ -63,7 +64,8 @@ const Datepicker: React.FC<Props> = ({
6364 i18n = "en" ,
6465 disabled = false ,
6566 inputClassName = null ,
66- containerClassName = null
67+ containerClassName = null ,
68+ displayFormat = "YYYY-MM-DD"
6769} ) => {
6870 // Ref
6971 const containerRef = useRef < HTMLDivElement > ( null ) ;
@@ -214,7 +216,9 @@ const Datepicker: React.FC<Props> = ({
214216 end : formatDate ( endDate )
215217 } ) ;
216218 setInputText (
217- `${ formatDate ( startDate ) } ${ asSingle ? "" : ` ~ ${ formatDate ( endDate ) } ` } `
219+ `${ formatDate ( startDate , displayFormat ) } ${
220+ asSingle ? "" : ` ~ ${ formatDate ( endDate , displayFormat ) } `
221+ } `
218222 ) ;
219223 }
220224 }
@@ -225,7 +229,7 @@ const Datepicker: React.FC<Props> = ({
225229 end : null
226230 } ) ;
227231 }
228- } , [ asSingle , value ] ) ;
232+ } , [ asSingle , value , displayFormat ] ) ;
229233
230234 // Variable
231235 const colorPrimary = useMemo ( ( ) => {
You can’t perform that action at this time.
0 commit comments