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
Locale - Korean(ko) formats Month seems not right #688
Comments
@whtFlower Can you offer some more detail, please? (code console.log ...) |
On our application we use dayjs and I am trying to implement i18n. While I was going through formats I have noticed that Korean version (ko) has the following format: It happen to be that I am very familiar with Japanese and also can read some Chinese characters. After looking up those two locales I am wondering if Korean need to be 'YYYY년 M월 D일' like those two other locales. Also it seems like the space seems inconsistent to me. I might be wrong -as I said I am not too familiar with i18n and lots of these are just guessing. -by the way, is there easy way to extract YYYY only with locale? Trying to add locale for input field with placeholder of 'YYYY'. I am using formats.LL and extract month/year/date with substring. Not sure if that is the best way to do get them. |
We just keep the same with https://github.com/moment/moment/blob/develop/locale/ko.js you can use dayjs().format('YYYY') |
I see. I see months, weekdays, weekdaysShort, weekdaysMin. |
Seems we don't have a key named |
@iamkun moment().format("YYYY") returns current year. What I need is |
dayjs.format('YYYY년') is what you are looking for 😬 |
@iamkun I am trying to add correct i18n for the place of 'YYYY' (en) which should be 'YYYY년'. since you guys have locale set up already, I am wondering if there is easy way for me to get YYYY in different language. |
you can import 'dayjs/locale/ko' as an object and update it to the value you want. Then set as a custom locale check here https://github.com/iamkun/dayjs/blob/dev/docs/en/I18n.md#customize |
I am not too familiar with i18n. However just looking at Korean/Japanese/Chinese, it seems like Korean format should be something like this(Notice the Month):
LL: 'YYYY년 MMMM D일', ==> 'YYYY년 M월 D일'
The text was updated successfully, but these errors were encountered: