File tree 3 files changed +15
-10
lines changed 3 files changed +15
-10
lines changed Original file line number Diff line number Diff line change @@ -264,27 +264,29 @@ const Datepicker: React.FC<Props> = ({
264
264
disabled,
265
265
inputClassName,
266
266
containerClassName,
267
- readOnly
267
+ readOnly,
268
+ displayFormat
268
269
} ;
269
270
} , [
270
271
asSingle ,
271
272
colorPrimary ,
272
273
configs ,
273
- dayHover ,
274
- firstGotoDate ,
275
274
hideDatepicker ,
276
- i18n ,
275
+ period ,
276
+ dayHover ,
277
277
inputText ,
278
278
onChange ,
279
- period ,
279
+ showFooter ,
280
280
placeholder ,
281
281
separator ,
282
- showFooter ,
282
+ i18n ,
283
283
value ,
284
284
disabled ,
285
285
inputClassName ,
286
286
containerClassName ,
287
- readOnly
287
+ readOnly ,
288
+ displayFormat ,
289
+ firstGotoDate
288
290
] ) ;
289
291
290
292
return (
Original file line number Diff line number Diff line change @@ -25,7 +25,8 @@ const Input: React.FC = () => {
25
25
separator,
26
26
disabled,
27
27
inputClassName,
28
- readOnly
28
+ readOnly,
29
+ displayFormat
29
30
} = useContext ( DatepickerContext ) ;
30
31
31
32
// UseRefs
@@ -173,7 +174,7 @@ const Input: React.FC = () => {
173
174
placeholder = {
174
175
placeholder
175
176
? placeholder
176
- : `YYYY-MM-DD ${ asSingle ? "" : ` ${ separator } YYYY-MM-DD ` } `
177
+ : `${ displayFormat } ${ asSingle ? "" : ` ${ separator } ${ displayFormat } ` } `
177
178
}
178
179
value = { inputText }
179
180
onChange = { handleInputChange }
Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ interface DatepickerStore {
32
32
inputClassName ?: string | null ;
33
33
containerClassName ?: string | null ;
34
34
readOnly ?: boolean ;
35
+ displayFormat ?: string ;
35
36
}
36
37
37
38
const DatepickerContext = createContext < DatepickerStore > ( {
@@ -59,7 +60,8 @@ const DatepickerContext = createContext<DatepickerStore>({
59
60
disabled : false ,
60
61
inputClassName : "" ,
61
62
containerClassName : "" ,
62
- readOnly : false
63
+ readOnly : false ,
64
+ displayFormat : "YYYY-MM-DD"
63
65
} ) ;
64
66
65
67
export default DatepickerContext ;
You can’t perform that action at this time.
0 commit comments