-
Notifications
You must be signed in to change notification settings - Fork 7.1k
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
[feature] Add era support for en,ja (closes #4591) #4599
Conversation
@eternalharvest the code looks decent. I think it can go in in next release. In the definition of the eras, why is BC ending on 31 Dec. Does it automatically round the day to the end? Shouldn't it be 1st Jan 0000 the end date for one era (BC) and the begining of the new era (AC). Also its not |
Sorry for late reply and thank u for reviewing my PR.
In my implementation, the date is truncated to the day value (by the method call In japan, the beginning time (hour, minute, second) of era is not defined by the law. If we redesign this feature to use datetime as the beginning time of era, I think we have to consider about timezone.
I fixed this wrong era definition. |
Any news on this one? |
@guisehn I think this PR satisfies with Japanese locale requirements though I'm not sure about any other locale specific problem or requirements itself. I wish this PR will be merged if there is no concern about this PR in any other locale. |
@eternalharvest if I may ask, what is the workaround you use in your project for now? I'm thinking in maybe creating a plugin so that I can avoid maintaining a fork just for my project while there's no decision about the pull request, but I'm wondering if there is already an existing plugin (I couldn't find) or workaround I could use. |
How is it going? I hope this feature is supported on moment asap. |
Merged in 4b615b9 |
[feature] Add era support for en,ja (closes #4591)
Description
Abstract
This PR implements new feature which is proposed in #4591.
I intended to implement this feature to format or parse Japanese date with era name, but this feature is carefully designed so that can be used in any other country.
Historically, there are more than 200 eras in Japan.
But before 6th Meiji era, our ancestors had been using Chinese lunar calendar.
And I think it is inappropriate to represent these historical dates in Gregorian solar calendar dates.
So I define only 4 eras and 2 Christian eras in Japanese locale.
Note: Japanese Meiji government had decided to use Gregorian solar calendar system since Jan 1st, Meiji 6 (Jan 1st 1873).
Currently there is only few country which is using era names, but I think this feature also can be used in Taiwan or some Buddhism country which is using Gregorian calendar.
Thanks and regards.
Related Issue
Format
Example
Locale (en)
Locale (ja)