tc39 / ecma402

Status, process, and documents for ECMA 402
https://tc39.es/ecma402/
Other
533 stars 104 forks source link

Which era should be the `year` anchor for the ethiopic calendar? #534

Open justingrant opened 3 years ago

justingrant commented 3 years ago

Temporal.PlainDate has two different year properties: an eraYear property that's used in a pair with era, and a signed year property (@sffc calls this "algebraic year") that's used without an era to better mirror ISO behavior and therefore make it easier to write code that works across all ICU calendars.

year is always relative to a per-calendar "anchor era". For almost all ICU calendars, the choice of anchor era is obvious because there's only one era that counts years forwards. (Backwards-counting eras like BC should never be the anchor.)

However, there are two ICU calendars with more than one forward-counting era: japanese and ethiopic. For japanese where there are many eras (with more expected in the future), we're planning to use the ISO year for year which sidesteps the anchor era question. See https://github.com/tc39/proposal-temporal/issues/526 for more details.

But what about ethiopic? There are two eras: one starting -005492-07-17 and another starting +000008-08-27. The first era is identical to ethioaa's only era, while the second era is unique to ethiopic.

Which era should be the anchor?

Option 1: -005492-07-17 should be the anchor because otherwise ethiopic's year would be identical to ethioaa's year, and SHOULD NOT be the same because the user presumably chose ethiopic not ethioaa for a good reason? Option 2: +000008-08-27 should be the anchor because ethiopic's year would be identical to ethioaa's year, and SHOULD be the same to maximize cross-calendar compatibility for developers servicing Ethiopian users?

I don't have enough context about how ethioaa vs. ethiopic is used to have an opinion about which option is better.

I assume that the answer depends on the cultural expectations of an ethiopic calendar user. If a year is shown with no era, would that user expect it to be relative to the earlier era or the later one?

@sffc @manishearth

Manishearth commented 3 years ago

No strong opinion but rough lean towards Option 2, because modern dates is what ethiopic folks would be used to.

justingrant commented 1 year ago

Should this issue be ported to https://github.com/tc39/proposal-intl-era-monthcode ? @FrankYFTang @sffc

sffc commented 1 year ago

The anchor era should be the one with the same name as the calendar, which is the one starting in 0008 CE

kabaros commented 3 months ago

I assume that the answer depends on the cultural expectations of an ethiopic calendar user. If a year is shown with no era, would that user expect it to be relative to the earlier era or the later one?

just to answer this part, I think the user - in Ethiopia - would expect year to be shown in the later era. We are using Temporal at dhis2 to support ethiopic calendars for Health Information System for the ministry of health in Ethiopia, we have created a wrapper around Temporal for our internal use, and in several places, we have code like this and this to accommodate the expectation that systems we integrate with expect the new era's year rather than the old ones.

justingrant commented 3 months ago

@sffc @Manishearth It sounds like @kabaros would prefer the ethiopic calendar's anchor to be the later era, different from ethioaa. Should we make this change in Temporal polyfills?

@kabaros thanks so much for your feedback!

sffc commented 3 months ago

Yes; it sounds like everyone in this thread is in agreement that year for ethiopic should be relative to the incar era starting on 0008-08-29 (après l’Incarnation)

justingrant commented 3 months ago

@kabaros - some follow-up questions for you about the Ethiopian calendar:

What is the era and year number before year 1 of the AA era? (This is the year that starts on -005492-07-17 in the ISO 8601 calendar.)

Is there a "year zero" in that era? Or is there another era used? Or is it irrelevant because the Ethiopian calendar is intended to record the beginning of the world, so the concept of "before the beginning of the world" doesn't really exist in this calendar?

Note that V8 today assumes that there's a year 0, a year -1, etc.

new Intl.DateTimeFormat("en", {calendar: 'ethiopic', timeZone: 'UTC'}).format(new Date('-005492-07-17'));
// => '1/1/1 ERA0'

new Intl.DateTimeFormat("en", {calendar: 'ethiopic', timeZone: 'UTC'}).format(new Date('-005492-07-16'));
// => '13/5/0 ERA0'

new Intl.DateTimeFormat("en", {calendar: 'ethiopic', timeZone: 'UTC'}).format(new Date('-005493-07-17'));
// => '13/6/-1 ERA0'
anba commented 3 months ago

Note that V8 today assumes that there's a year 0, a year -1, etc.

This isn't V8 specific, but actually directly comes from ICU4C. Compared to that, ICU4X currently uses two eras incar and pre-incar (https://docs.rs/icu/latest/icu/calendar/ethiopian/struct.Ethiopian.html#era-codes), which aren't really compatible with the era codes from https://tc39.es/proposal-intl-era-monthcode/#table-eras.

Also see:

kabaros commented 3 months ago

What is the era and year number before year 1 of the AA era? (This is the year that starts on -005492-07-17 in the ISO 8601 calendar.)

@justingrant - I am not sure about the answer to this. I am forwarding the question to my colleague @abyot. He knows much more about ethiopic calendars than me.

justingrant commented 3 months ago

@Manishearth @sffc do you have any guidance for these questions about era definition?

Manishearth commented 3 months ago

Or is it irrelevant because the Ethiopian calendar is intended to record the beginning of the world, so the concept of "before the beginning of the world" doesn't really exist in this calendar?

It should be irrelevant, I'm not aware of any calendar which is anchored on a world-creation date for an era and also has any accepted rendering for dates before that.

(though technically all ecclesiastical calendars for Abrahamic religions have an Anno Mundi that is after the seven days of Creation, so technically there might be a reason to talk of a small number of dates pre-A.M. It does not appear that anyone actually does so in terms of actual dates rather than "day of Creation")

sffc commented 3 months ago

CLDR data:

        <calendar type="ethiopic">
          <calendarSystem type="other"/>
          <eras>
              <era type="0" end="8-08-28" code="ethioaa" aliases="ethiopic-amete-alem mundi"/>
              <era type="1" start="8-08-29" code="ethiopic" aliases="incar"/>
          </eras>
        </calendar>
        <calendar type="ethiopic-amete-alem">
          <eras>
              <era type="0" end="-5492-08-29" code="ethioaa" aliases="ethiopic-amete-alem mundi"/>
          </eras>
        </calendar>

So dates before epoch should be represented in the mundi era according to CLDR.

I'm still waiting on proposal-intl-era-monthcode to land to clear things up.

justingrant commented 3 months ago

So dates before epoch should be represented in the mundi era according to CLDR.

According to CLDR, does mundi have a year zero? And what's the year before mundi 1? What's two years before that year?

sffc commented 3 months ago

So dates before epoch should be represented in the mundi era according to CLDR.

According to CLDR, does mundi have a year zero? And what's the year before mundi 1? What's two years before that year?

Unless specified otherwise, years are considered to be ..., -2, -1, 0, 1, 2, ... and eras that use 1-N counting are indicated with "inverse" in the XML