File tree Expand file tree Collapse file tree 3 files changed +15
-10
lines changed Expand file tree Collapse file tree 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> = ({
264264 disabled,
265265 inputClassName,
266266 containerClassName,
267- readOnly
267+ readOnly,
268+ displayFormat
268269 } ;
269270 } , [
270271 asSingle ,
271272 colorPrimary ,
272273 configs ,
273- dayHover ,
274- firstGotoDate ,
275274 hideDatepicker ,
276- i18n ,
275+ period ,
276+ dayHover ,
277277 inputText ,
278278 onChange ,
279- period ,
279+ showFooter ,
280280 placeholder ,
281281 separator ,
282- showFooter ,
282+ i18n ,
283283 value ,
284284 disabled ,
285285 inputClassName ,
286286 containerClassName ,
287- readOnly
287+ readOnly ,
288+ displayFormat ,
289+ firstGotoDate
288290 ] ) ;
289291
290292 return (
Original file line number Diff line number Diff line change @@ -25,7 +25,8 @@ const Input: React.FC = () => {
2525 separator,
2626 disabled,
2727 inputClassName,
28- readOnly
28+ readOnly,
29+ displayFormat
2930 } = useContext ( DatepickerContext ) ;
3031
3132 // UseRefs
@@ -173,7 +174,7 @@ const Input: React.FC = () => {
173174 placeholder = {
174175 placeholder
175176 ? placeholder
176- : `YYYY-MM-DD ${ asSingle ? "" : ` ${ separator } YYYY-MM-DD ` } `
177+ : `${ displayFormat } ${ asSingle ? "" : ` ${ separator } ${ displayFormat } ` } `
177178 }
178179 value = { inputText }
179180 onChange = { handleInputChange }
Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ interface DatepickerStore {
3232 inputClassName ?: string | null ;
3333 containerClassName ?: string | null ;
3434 readOnly ?: boolean ;
35+ displayFormat ?: string ;
3536}
3637
3738const DatepickerContext = createContext < DatepickerStore > ( {
@@ -59,7 +60,8 @@ const DatepickerContext = createContext<DatepickerStore>({
5960 disabled : false ,
6061 inputClassName : "" ,
6162 containerClassName : "" ,
62- readOnly : false
63+ readOnly : false ,
64+ displayFormat : "YYYY-MM-DD"
6365} ) ;
6466
6567export default DatepickerContext ;
You can’t perform that action at this time.
0 commit comments