Skip to content
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

Start of epoch for Islamic observational calendar doesn't match CLDR/ICU4C #4982

Open
anba opened this issue May 31, 2024 · 1 comment
Open
Labels
C-calendar Component: Calendars T-bug Type: Bad behavior, security, privacy

Comments

@anba
Copy link

anba commented May 31, 2024

CLDR and ICU4C both use July 15, 622 CE as the start of the epoch for the Islamic observational calendar:

Whereas ICU4X uses July 16, 622 CE:

  • // 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]"
@sffc
Copy link
Member

sffc commented May 31, 2024

@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)

@sffc sffc added the C-calendar Component: Calendars label May 31, 2024
@sffc sffc added the T-bug Type: Bad behavior, security, privacy label Jul 23, 2024
@sffc sffc added this to the 2.x Priority ⟨P2⟩ milestone Jul 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-calendar Component: Calendars T-bug Type: Bad behavior, security, privacy
Projects
None yet
Development

No branches or pull requests

2 participants