icu4x
icu4x copied to clipboard
Start of epoch for Islamic observational calendar doesn't match CLDR/ICU4C
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:
- https://github.com/unicode-org/icu4x/blob/5e7585c9457560549c1ceacec1b341a6c348ec6c/utils/calendrical_calculations/src/islamic.rs#L7-L9
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]"
@roozbehp, do you have thoughts on this?
Reingold says on page 106:
The calendar is computed, by the majority of the Muslim world, starting at sunset of Thursday, July 15, 622 c. e. (Julian), the year of Mohammed’ s migration to Medina from Mecca. 2 The introduction of the calendar is often attributed to the Caliph ‘Umar in 639 c. e., but there is evidence that it was in use before his succession. In essence, Muslims count r. d. 227015 = Friday, July 16, 622 c. e. (Julian) as the beginning of the Islamic year 1, that is, as Muḥarram 1, a. h. 3 1, and thus we define
islamic-epoch def () = fixed-from-julian 622 c. e. july 16 (7.1)
Here's what I see for day of Sha'aban, 1446 AH on Gregorian Feb 26, 2025:
https://www.ummulqura.org.sa/ : 27 https://www.islamiccal.com/en/islamic-date-today/ : 27 "This is according to the Umm Al-Qura calendar, which is the official Islamic calendar type in most countries." https://en.m.wikipedia.org/wiki/Islamic_calendar : 27
ICU4X 1.5 as integrated in Firefox Nightly Temporal.Now.plainDateISO().withCalendar(cal).day :
islamic: 27
islamic-civil: 27
islamic-umalqura: 28
islamic-tbla: 28
ICU4C 76.1 as integrated in Firefox Nightly new Intl.DateTimeFormat("en", { calendar: cal}).format(new Date()) :
islamic: 28
islamic-civil: 27
islamic-umalqura: 27
islamic-tbla: 28
Filed https://unicode-org.atlassian.net/browse/CLDR-18348 about CLDR (does not affect the substance here).
islamic-umalqura: 28
Filed https://github.com/unicode-org/icu4x/issues/6197