-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
Wrong Intl.DateTimeFormat output for zh-CN without year part #29596
Comments
Node v12.10.0
Node v12.10.0 with full-icu
|
I have verified that both v12.10.0 and v10.14.2 I tested are with small-icu, according to https://nodejs.org/docs/latest-v10.x/api/intl.html
v10.x is ok for Intl.DateTimeFormat + zh-CN but 12.x is not. |
Can't reproduce. Both master and v12.10.0 with small-icu pritn edit: and to be clear: yes, that's a slash, not a dash. |
@bnoordhuis I guess your system locale is en-US or similar (mine is zh-CN). If I run node v12.10.0 with a overwritten locale( |
With I don't know if it's actually a bug but @srl295 can probably shed some light on that.
It does when ICU doesn't know the timezone name you pass to Fixing the fallback locale to some known-good value has been discussed in the past but being able to override it is sometimes useful. |
@bnoordhuis I checked v10.16.3 and it doesn't affected (https://nodejs.org/dist/v10.16.3/node-v10.16.3-linux-x64.tar.xz ). Omitting the
|
Hm, right. I reverted the ICU upgrade in my local v10.x branch and it indeed makes no difference. I suppose that means a change in V8 is responsible (or the interaction between ICU and V8) but the diff between V8 6.8 and 7.6 is so big that it's hopeless to isolate the change. There are plans to bundle full-icu with Node.js (#19214) so this issue will probably become moot in the not too distant future.
Yes, I should have said "timezone or locale." (I did refer to the locale in the next sentence but not the first one.) |
Sounds good to me. For now my workaround is adding a |
Okay, I'll go ahead and do that. For everyone coming here through search engines: installing the full-icu package should fix this in a forward compatible manner. |
Test code:
nodejs v12.10.0 outputs a strange string
'09 ├Day: 16┤'
.On nodejs v10.14.2, the result is
'09-16'
, which is correct.The text was updated successfully, but these errors were encountered: