镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Date.toLocalString() return incorrect string #8654

Description

@StCremer
  • Version: 6.6.0
  • Platform: linnux SentOs7
  • 'uname-a' output: Linux localhost.localdomain 3.10.0-327.28.3.el7.x86_64 deps: update openssl to 1.0.1j #1 SMP Thu Aug 18 19:05:49 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

I'm tying to output date in local format with Russian locale

    Date.toLocaleDateString('ru',{ month: 'short',
            weekday: 'long',
            day: 'numeric'})

I get this in my code.
Even if i do in REPL

> let d=new Date()
undefined
> console.log(d.toLocaleDateString('ru',{month: 'short',weekday:'long', day:'numeric'}))
M09 19, Mon
undefined
> console.log(d.toLocaleDateString('en',{month: 'short',weekday:'long', day:'numeric'}))
Monday, Sep 19
undefined

As you can see english locale works perfect but any other language returns incorrect string.

Browsers for the same code return correct string
понедельник, 19 сент.

First i met this problem in NodeJs 6.4.0 but after update the problem doesn't go

Activity

  1. evanlucas commented on Sep 19, 2016

    @evanlucas
    Contributor

    I'm pretty sure the binaries on nodejs.org only come bundled with small-icu with english. I believe you would have to compile node with full-icu to make this work. /cc @nodejs/intl

  2. bnoordhuis commented on Sep 19, 2016

    @bnoordhuis
    Member

    You can also npm install full-icu.

    I'll close, working as intended.

  3. added
    invalidIssues and PRs that are invalid.
    i18n-apiIssues and PRs related to Node.js internationalization support.
    on Sep 19, 2016
  4. StCremer commented on Sep 21, 2016

    @StCremer
    Author

    Thanks! i'll try!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    i18n-apiIssues and PRs related to Node.js internationalization support.invalidIssues and PRs that are invalid.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions