-
Notifications
You must be signed in to change notification settings - Fork 264
Open
Labels
C-calendarComponent: CalendarsComponent: CalendarsT-bugType: Bad behavior, security, privacyType: Bad behavior, security, privacy
Milestone
Description
CLDR and ICU4C both use July 15, 622 CE as the start of the epoch for the Islamic observational calendar:
- https://github.com/unicode-org/cldr/blob/c1dc8c7ef6584668345cf741e51b1722d8114bc8/common/supplemental/supplementalData.xml#L4682-L4711
- https://github.com/unicode-org/icu/blob/3235c38f24711a86d7fc5adf5e536bf6a4f1d10a/icu4c/source/i18n/islamcal.h#L33-L36
Whereas ICU4X uses July 16, 622 CE:
icu4x/utils/calendrical_calculations/src/islamic.rs
Lines 7 to 9 in 5e7585c
// Different islamic calendars use different epochs (Thursday vs Friday) due to disagreement on the exact date of Mohammed's migration to Mecca. /// Lisp code reference: <https://github.com/EdReingold/calendar-code2/blob/main/calendar.l#L2066> const FIXED_ISLAMIC_EPOCH_FRIDAY: RataDie = crate::julian::fixed_from_julian(622, 7, 16);
Does it make sense to align ICU4X with CLDR/ICU4C?
According to CLDR, only "islamic-civil" should use July 16, 622 CE, but interestingly ICU4C also uses July 16, 622 CE for "islamic-umalqura". When calling ICU4C through Intl.DateTimeFormat:
js> new Intl.DateTimeFormat("en", {calendar:"islamic", timeZone:"UTC"}).format(Date.parse("0622-07-19T00:00:00.000Z"))
"1/2/1 AH"
js> new Intl.DateTimeFormat("en", {calendar:"islamic-civil", timeZone:"UTC"}).format(Date.parse("0622-07-19T00:00:00.000Z"))
"1/1/1 AH"
js> new Intl.DateTimeFormat("en", {calendar:"islamic-tbla", timeZone:"UTC"}).format(Date.parse("0622-07-19T00:00:00.000Z"))
"1/2/1 AH"
js> new Intl.DateTimeFormat("en", {calendar:"islamic-umalqura", timeZone:"UTC"}).format(Date.parse("0622-07-19T00:00:00.000Z"))
"1/1/1 AH"In comparison when implementing Temporal using ICU4X:
js> Temporal.PlainDate.from({calendar:"islamic", year: 1, month: 1, day: 1}).toString()
"0622-07-19[u-ca=islamic]"
js> Temporal.PlainDate.from({calendar:"islamic-civil", year: 1, month: 1, day: 1}).toString()
"0622-07-19[u-ca=islamic-civil]"
js> Temporal.PlainDate.from({calendar:"islamic-tbla", year: 1, month: 1, day: 1}).toString()
"0622-07-18[u-ca=islamic-tbla]"
js> Temporal.PlainDate.from({calendar:"islamic-umalqura", year: 1, month: 1, day: 1}).toString()
"0622-07-18[u-ca=islamic-umalqura]"Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
C-calendarComponent: CalendarsComponent: CalendarsT-bugType: Bad behavior, security, privacyType: Bad behavior, security, privacy