Skip to content

Commit

Permalink
Merge pull request #398 from MohammedFaragallah/master
Browse files Browse the repository at this point in the history
handle Arabic numbers formats
  • Loading branch information
iM-GeeKy authored Aug 23, 2024
2 parents aee993d + 233dcbe commit f153c05
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Date/dateUtils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,13 @@ export function useInputFormat({
return useMemo(() => {
// TODO: something cleaner and more universal?
const inputDate = formatter.format(new Date(2020, 10 - 1, 1))

if (inputDate.includes('٢٠٢٠')) {
return inputDate
.replace('٢٠٢٠', 'YYYY')
.replace('١٠', 'MM')
.replace('٠١', 'DD')
}
return inputDate
.replace('2020', locale === 'pt' ? 'AAAA' : 'YYYY')
.replace('10', 'MM')
Expand Down

0 comments on commit f153c05

Please sign in to comment.