Node: Wrong Intl.DateTimeFormat formatting

Created on 25 Jun 2017  路  3Comments  路  Source: nodejs/node

  • Version: v8.1.2 / v7.9.0
  • Platform: Windows 10 Pro 1703 (16226.1000, Insider Build)

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:

  • v8.1.2: '2017 M06 25'
  • v7.9.0: 'June 25, 2017
i18n-api question

All 3 comments

You 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!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

addaleax picture addaleax  路  3Comments

seishun picture seishun  路  3Comments

sandeepks1 picture sandeepks1  路  3Comments

stevenvachon picture stevenvachon  路  3Comments

vsemozhetbyt picture vsemozhetbyt  路  3Comments