Skip to content

Commit 2dbe93f

Browse files
committed
[Fix 🐛] resolve #270 not parse local parameters to dateFormat function
1 parent bebb5f7 commit 2dbe93f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Diff for: src/components/Datepicker.tsx

+5-3
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,10 @@ const Datepicker = (props: DatepickerType) => {
224224
});
225225

226226
setInputText(
227-
`${dateFormat(value.startDate, displayFormat)}${
228-
asSingle ? "" : ` ${separator} ${dateFormat(value.endDate, displayFormat)}`
227+
`${dateFormat(value.startDate, displayFormat, i18n)}${
228+
asSingle
229+
? ""
230+
: ` ${separator} ${dateFormat(value.endDate, displayFormat, i18n)}`
229231
}`
230232
);
231233
}
@@ -239,7 +241,7 @@ const Datepicker = (props: DatepickerType) => {
239241

240242
setInputText("");
241243
}
242-
}, [asSingle, value, displayFormat, separator]);
244+
}, [asSingle, value, displayFormat, separator, i18n]);
243245

244246
useEffect(() => {
245247
if (startFrom && dateIsValid(startFrom)) {

0 commit comments

Comments
 (0)