Closed paulbrie closed 8 years ago
did u look into this?
https://github.com/jquery/globalize
i was a bit mislead by the fact it's part of jquery. nothing to do with it
hi Paul,
As you mentioned, Moment.js seems to be the most useful for dates, because is flexible enough. For React I used react-intl
you can find it here https://github.com/yahoo/react-intl
as @raulmatei said, for React you could use react-intl, I've used it and it's quite simple and it has support for date
Thanks to all! That was really helpful, I have a good overview about the options. Will let you know about my choice. Thanks! ;)
Hi all,
this topic seems trivial, but I've spent quite some time on it. So here it is.
I'm using React for a website localized in two languages: RO, EN. My dates are coming from the server in ISO format (example:
2016-09-18T21:15:28.594Z
).Now I would like to localize this date in a human readable format for RO and EN. I would like to get:
Luni 19 septembrie 2016
Monday, September 19th, 2016
I don't find any native solution for this problem. The closest would be
toLocaleDateString('fr-FR')
- which by the way accepts a localisation parameter, but is still not enough. At this point there's only http://momentjs.com/docs/#/i18n/ which has some solid localization but I wondered if you guys know other ways.