Skip to content

Commit f153c05

Browse files
authored
Merge pull request #398 from MohammedFaragallah/master
handle Arabic numbers formats
2 parents aee993d + 233dcbe commit f153c05

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
@@ -241,6 +241,13 @@ export function useInputFormat({
241241
return useMemo(() => {
242242
// TODO: something cleaner and more universal?
243243
const inputDate = formatter.format(new Date(2020, 10 - 1, 1))
244+
245+
if (inputDate.includes('٢٠٢٠')) {
246+
return inputDate
247+
.replace('٢٠٢٠', 'YYYY')
248+
.replace('١٠', 'MM')
249+
.replace('٠١', 'DD')
250+
}
244251
return inputDate
245252
.replace('2020', locale === 'pt' ? 'AAAA' : 'YYYY')
246253
.replace('10', 'MM')

0 commit comments

Comments
 (0)