You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my app, I use window.navigator.languages to decide which locale to use to render relative date for my users. One thing I noticed is that zh is a valid locale in browsers, but not available in dayjs. It's an issue because I'm forced to pick a locale between zh-cn, zh-tw, and zh-hk for the user, and I don't know which to pick.
To see zh in Chrome, go to the ⋮ menu -> Settings -> Advanced (on the left sidebar) -> Languages -> Add languages -> Add Chinese. Then you'll see zh appear in your navigator.languages.
There are already other cases where a generic locale and its sub locales co-exists in dayjs, for example, es, es-us, es-do; fr, fr-ca, fr-ch, so I think adding a zh is completely reasonable.
I'd be happy to submit a PR if this can be agreed upon.
The text was updated successfully, but these errors were encountered:
In my app, I use
window.navigator.languages
to decide which locale to use to render relative date for my users. One thing I noticed is thatzh
is a valid locale in browsers, but not available in dayjs. It's an issue because I'm forced to pick a locale betweenzh-cn
,zh-tw
, andzh-hk
for the user, and I don't know which to pick.To see
zh
in Chrome, go to the ⋮ menu -> Settings -> Advanced (on the left sidebar) -> Languages -> Add languages -> AddChinese
. Then you'll seezh
appear in yournavigator.languages
.There are already other cases where a generic locale and its sub locales co-exists in dayjs, for example,
es
,es-us
,es-do
;fr
,fr-ca
,fr-ch
, so I think adding azh
is completely reasonable.I'd be happy to submit a PR if this can be agreed upon.
The text was updated successfully, but these errors were encountered: