Skip to content

Commit 14b3cea

Browse files
handle arabic numbers formats
1 parent ce9d1ba commit 14b3cea

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/Date/dateUtils.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,13 @@ export function useInputFormat({
234234
return React.useMemo(() => {
235235
// TODO: something cleaner and more universal?
236236
const inputDate = formatter.format(new Date(2020, 10 - 1, 1))
237+
238+
if (inputDate.includes('٢٠٢٠')) {
239+
return inputDate
240+
.replace('٢٠٢٠', 'YYYY')
241+
.replace('١٠', 'MM')
242+
.replace('٠١', 'DD');
243+
}
237244
return inputDate
238245
.replace('2020', locale === 'pt' ? 'AAAA' : 'YYYY')
239246
.replace('10', 'MM')

0 commit comments

Comments
 (0)