react-datepicker icon indicating copy to clipboard operation
react-datepicker copied to clipboard

Switch from date-fns to the browser's Intl

Open dgreene1 opened this issue 1 year ago • 7 comments

Is your feature request related to a problem? Please describe. Yes, the problem is that if I want to support internationalization for multiple countries, I can't support countries that date-fns doesn't support. And at my company, that means that 30 of the countries we want to support we can't. (Note: the support for many countries in the English language is severely limited in date-fns and the work to contribute those would be massively cost prohibitive).

Describe the solution you'd like Instead of relying on date-fns to format dates, we would use Intl since it's supported in all major browser versions now.

Describe alternatives you've considered As mentioned, we considered adding our needed formatters to date-fns but it would take months or years to add them all. And then to keep them up to date would be a massive undertaking.

Additional context You'll notice that Saudia Arabia and Greece do not exist in the english language here: https://github.com/date-fns/date-fns/blob/16c529508a323d78f70b91209ebf043f3c09671d/src/locale/index.ts#L29

dgreene1 avatar Jul 07 '23 19:07 dgreene1