This repository has been archived by the owner on Feb 29, 2020. It is now read-only.
[Discussion] Create instances of DateTimeFormat
and NumberFormat
without the first argument locale
is problematic
#14
Labels
In most cases, when doing
new Intl.DateTimeFormat().format(1234);
on the client side will work well since it will use the user's preferences to render the date, but that's not the case of nodejs/iojs when rendering data on the server side since that will rely on the server's preferences rather than the user's preferences to render that piece of data.Ideally, developers will alway negotiate the locale per request, and use it to create new instances of
DateTimeFormat
andNumberFormat
, but some might call this an unnecessary overhead. What are your thoughts around this? Should we have a mode where we warn about this? Should we try to negotiate with ECMA402 to have a more comprehensive solution around the default locale?On top of this, most people will end up caching instances of
DateTimeFormat
andNumberFormat
between requests because the fact that they are very very expensive to create compared to traditional javascript objects, I wonder if we should provide some out-of-the-box instances in node.The text was updated successfully, but these errors were encountered: