3 ms·
> You will still need libraries to do nicely formatted time strings like "next week" or "3 hours ago" If you want those formatted values to be consistent with
by josteink 6y ago
> You will still need libraries to do nicely formatted time strings like "next week" or "3 hours ago"
If you want those formatted values to be consistent with the rest of your app, you will need this anyway.
You app does support localisation right?
Also: there’s no guarantee a browser would have the same localisation as your app (for instance German-language browser, English website).
You really have to do this 100% yourself in your app if you want the result to look right.
- runarberg 6y agoApps are seldomly translated into my native language, but I do have my browser configured to use my native language, so I often see date values in a different language from the rest of the app, and it doesn’t bother me at all. In fact I hardly notice it.
- jacobr 6y agoYou would do new Intl.DateTimeFormat(siteLocale) and not new Intl.DateTimeFormat(browserLocale) to get consistent formatting.