Intl.DateTimeFormat function gives wrong results in NodeJS
new Intl.DateTimeFormat('ru-RU', {
month: 'long',
day: 'numeric',
year: 'numeric'
}).format(new Date())
Expected result (from Chrome 58.0.3029.110): '25 懈褞薪褟 2017 谐.'
Actual result:
'2017 M06 25''June 25, 2017You need to install full ICU data, as the default Node.js build does not come with any locale other than English. Check out https://github.com/nodejs/node/wiki/Intl and the full-icu npm package.
Thanks for info. But there's a problem with full-icu package: https://github.com/unicode-org/full-icu-npm/issues/6#issuecomment-310870401
Node v8 not auto detects it..
@DaFri-Nochiterov You can use either the NODE_ICU_DATA environment variable or the --icu-data-dir CLI parameter. Check out my current WIP documentation for Intl: https://gist.github.com/TimothyGu/e3659a3e51440e1733751f675c81321c#providing-icu-data-at-runtime (I will submit this as a PR soon).
Closing this issue. If you have further questions, please file an issue on the Help repository https://github.com/nodejs/help. Thanks!