-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
add zh locale #822
add zh locale #822
Conversation
In Chrome, in window.navigator.languages, there are 4 valid Chinese locales that could appear: zh, zh-CN, zh-TW, zh-HK. Currently zh is missing from dayjs. This PR adds the zh locale. The zh locale has some minor improvements over the other 3. For developers, this won't affect your existing code, but if you start using zh, your output will be slightly more correct in some occasional cases.
Codecov Report
@@ Coverage Diff @@
## dev #822 +/- ##
===================================
Coverage 100% 100%
===================================
Files 157 158 +1
Lines 1148 1165 +17
Branches 215 222 +7
===================================
+ Hits 1148 1165 +17
Continue to review full report at Codecov.
|
please add test |
Honestly I looked everywhere in the codebase and didn't find how it should be tested, and why existing tests are not passing... I compared with #516, which didn't add any tests either, and seems it did exactly the same thing as this one. 哭了 |
test/locale/zh-cn.test.js |
Cool, I'll keep the same at this moment. And update it all together later. |
🎉 This PR is included in version 1.8.23 🎉 The release is available on: Your semantic-release bot 📦🚀 |
In
window.navigator.languages
in Chrome, there are 4 valid Chinese locales that could appear:zh
,zh-cn
,zh-cn
,zh-hk
. Currentlyzh
is missing from dayjs. This PR adds thezh
locale.zh
has some minor improvements over the other 3 locales. For developers, this won't affect your existing code, but if you start usingzh
, your output will be slightly more correct in some occasional cases.For example:
issue #820