Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Intl.DateTimeFormat - wrong long weekday #2150

Closed
arxeiss opened this issue Aug 28, 2019 · 4 comments
Closed

Intl.DateTimeFormat - wrong long weekday #2150

arxeiss opened this issue Aug 28, 2019 · 4 comments

Comments

@arxeiss
Copy link

arxeiss commented Aug 28, 2019

  • Version: v12.9.0
  • Platform: Ubuntu 19.04 Linux 5.0.0-25-generic GitHub issue management node#26-Ubuntu SMP Thu Aug 1 12:04:58 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

I think it is related to nodejs/node#26790 because when no full ICU is installed and I have different locale, weekday long always returns short.

new Intl.DateTimeFormat('cs-CZ', { weekday: 'long', timeZone: 'UTC' }).formatToParts(new Date('2017-10-30'))[0].value; // Mon

new Intl.DateTimeFormat('en-US', { weekday: 'long', timeZone: 'UTC' }).formatToParts(new Date('2017-10-30'))[0].value; // Monday

If localisation for cs-CZ is not installed, it returns fallback English name? Because for months it works differently, for cs-CZ it returns M10

@bnoordhuis
Copy link
Member

Without full-icu node only knows about en-US so yes.

I'm going to close this as answered but I can move it to nodejs/help if you have follow-up questions.

@arxeiss
Copy link
Author

arxeiss commented Aug 28, 2019

@bnoordhuis Not it is not answered.. If fallback to english is used, why then weekday long is Mon and not Monady - so it is short, not long?

And for month is returned M10 instead of english fallback?

@bnoordhuis bnoordhuis transferred this issue from nodejs/node Aug 28, 2019
@bnoordhuis bnoordhuis reopened this Aug 28, 2019
@bnoordhuis
Copy link
Member

The answer to your questions is mostly 'because ICU' - that's the library that implements the i18n logic, not node or V8 itself.

@arxeiss
Copy link
Author

arxeiss commented Aug 28, 2019

OK, according to issue into which I referenced before (nodejs/node#26790) I thought, that this is nodejs thing. But if it has nothing to do with node itself, than there is no place to fix it.

So probably it can stay closed - thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants