-
Notifications
You must be signed in to change notification settings - Fork 8
Update various era codes #39
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
Conversation
unicode-org/cldr#4519 is mostly done but waiting on some questions to be answered, and it should be considered the source of truth for era codes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should proceed merging this without the era codes that are equal to the calendar names, and without the *-inverse
codes. As per #12, the consensus seems to be that nobody wants them. They are also not in unicode-org/cldr#4519, and although that is still under discussion, there was only one dissenter who has not followed up. So if CLDR changes back, we can add the aliases back in another PR.
I'm wondering what we should do with |
See the recommendation in #28 |
ECMA could still decide to omit those aliases, although then we would be diverging from CLDR which is undesirable. |
Thanks for all the suggestions above, I updated the PR to remove all the era names that matched the calendar or were of the type |
312daf8
to
5fe26c9
Compare
Updated the codes to match exactly everything in unicode-org/cldr#4519 with the exception of Chinese and Dangi which no longer have era codes in CLDR. What should we do here? Should I no longer list the era codes for those calendars, stick to the ones named exactly the same as the calendar or switch to BCE and CE (like we do for some interval in the Japanese calendar)? |
See the discussion above: #39 (comment) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also delete the chinese
and dangi
rows as per Shane's recommendation in #28, and check that that doesn't mess up any assertions with CalendarSupportsEra
The changes from unicode-org/cldr#4581 to add |
Remove the "stub" era codes for the Chinese and Dangi calendars and the am-inverse era for the Coptic calendar, making the am era go back all the way to -infinity instead.
Okay I believe I have addressed the recent comments in the last few commits. The entire diff is a bit messy but the individual commits should be easier to review. |
Do we actually need any entries for calendars which don't use multiple eras? For example
This also matches the implementation in the spec polyfill and in Firefox: js> new Temporal.PlainDate(2025, 1, 1, "buddhist").era === undefined
true
js> new Temporal.PlainDate(2025, 1, 1, "hebrew").era === undefined
true |
@anba I suppose it's an open question. My personal opinion is that it matters. For instance the Hindu calendar might just have the "shaka" (transliteration is hard, my personal experience is to see it referred to more often as "saka") era but it is an era in that calendar (and therefore reveals important information) and formatting the date without it might confuse a reader. Note that in an interface or a formatted result it might not be easy for the reader in some contexts to tell which calendar a date is supposed to be in and therefore the "shaka", "be" or "am" suffix for the era might be necessary for the reader to be able to discern a date in a calendar from (Proleptic) Gregorian dates which are generally formatted without an era code outside of history-related contexts. |
I don't think formatting is relevant for the Formatting is also locale-dependent, see tc39/proposal-temporal#2899 for examples where dates are formatting without eras when using locales which actually use the calendars. |
You're right about this but about the To be more specific, I'm thinking along the lines of the question: "does the calendar have eras? which era is currently ongoing?". For instance |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 All good
@anba Re. dropping eras in Temporal for calendars with only one era, I personally like your suggestion better and I did it that way in the reference code as you mentioned, but I would prefer to go with this approach for two reasons:
I'm going to merge this and if you feel strongly that it should be otherwise, please open a new issue for dropping the lone eras and advocate for it in TG2. |
Sorry for being late to the party, but I agree that showing single eras seems helpful, specifically for discoverability in some calendars where the era code might clarify what the calendar means. I'm specifically thinking of |
Yes, we should return the era code for single-era calendars. A rule of thumb is that if you can talk about the era (if the era has a name), then the era is a real thing and should have an identifier. There is no era code for Chinese because there is no such thing as an era in that calendar. But Coptic, Buddhist, Hebrew, etc., all have an era with a well-defined name (Anno Martyrdom, Buddhist Era, Anno Mundi). |
Update era codes to sync with <tc39/proposal-intl-era-monthcode#39>: - Hijri calendars now have an inverse era `bh`. - Era names matching the calendar name have been removed. Differential Revision: https://phabricator.services.mozilla.com/D255510
Update era codes to sync with <tc39/proposal-intl-era-monthcode#39>: - Hijri calendars now have an inverse era `bh`. - Era names matching the calendar name have been removed. Differential Revision: https://phabricator.services.mozilla.com/D255510
Update era codes to sync with <tc39/proposal-intl-era-monthcode#39>: - Hijri calendars now have an inverse era `bh`. - Era names matching the calendar name have been removed. Differential Revision: https://phabricator.services.mozilla.com/D255510
Recently after some discussion in TG2 we concluded the era codes for a number of calendars. This PR addresses all of those issues and updates the "location" metadata field.