Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 26 additions & 5 deletions components/calendar/src/cal/hijri.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,19 @@ mod ummalqura_data;
///
/// There are either 6 or 7 30-day months, so the length of the year is 354 or 355 days.
///
/// # Crescent moon visibility
///
/// According to Islam, months begin when an observer first sees the crescent moon.
///
/// For centuries, astronomers have been developing criteria for predicting crescent moon
Copy link
Member

@hsivonen hsivonen Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we shouldn't land this change. This change pushes the docs even further to the direction of suggesting that modeling religious Hijri calendar use by approximation is something that internationalized software should do and that ICU4X is suited for doing. I think we don't have evidence that this is what we should be suggesting to app developers who delegate i18n expertise to ICU4X.

I think we should have the discussions we are having in parallel to this pull request about scope. I think we shouldn't be leaning into ways to rationalize keeping shipping SimulatedHijri, when it continues to look to me that we have it because it's sunk-cost code that's appealing to programmers even though we haven't seen a presentation of strong evidence of any particular instantiation of SimulatedHijri addressing substantial user needs. The Cairo parameter came about because it was an example parameter. As for the Mecca parameter, I think we continue to lack a strong case for providing an unofficial Mecca-reference simulation when we provide an official Mecca-reference simulation.

My preference would be to steer the docs in the direction of the following:

  • Umm al-Qura is a civil-use calendar that is a Mecca-reference simulation calculated by KACST (with clarity about the data range and fallback).
  • Considering the user feedback to Google that resulted in CLDR no longer attesting Umm al-Qura as the primary calendar for Saudi Arabia, we shouldn't be characterizing the current usage level or usage situations of Umm al-Qura unless we actually know.
  • AFAICT islamic-civil is in CLDR, because IBM picked it for reasons that we don't have visibility into, and now it also serves as ICU4C-compatible out-of-KACST-range fallback for Umm al-Qura, and islamic-tbla is CLDR because Microsoft picked it for reasons we don't have visibility into (I think we shouldn't retell the stated story without commentary, and commentary doesn't belong in our docs, so I think we shouldn't be telling the stated story).
  • Tabular Hijri is a centuries old well-known concept, but we shouldn't be suggesting a particular use case for app developers unless we actually know, considering that IBM and Microsoft software compat rather than a more specific use case seems to be why they are included.
  • Various sources claim that the leap year rule that both islamic-tbla and islamic-civil use is the most common one. It's unclear to me to what extent these sources are repeating each other, but it's likely OK for us to repeat the claim. It's easy to believe that this is why both IBM and Microsoft picked this leap year cycle, but that's a guess.

/// visibility. However, most regions that use the Hijri calendar rely on observations that
/// are impacted by atmospheric phenomena, meaning such predictions are only an approximation
/// of ground truth.
///
/// The primary exception is Saudi Arabia, where the KACST uses sophisticated telescopes to
Copy link
Member

@robertbastian robertbastian Dec 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what do sophisticated telescopes and observations have to do with UAQ? I also wouldn't necessarily call them "predictions", they are correct by definition

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They still claim to do observations. The calculations predict what their fancy infrared telescopes will see. I don't know what happens if they can't observe their prediction; I think they just claim that it won't ever happen, and they go to extreme measures to make sure that the crescent is visible when they claim it will be.

This is a good article on the subject:

https://www.middleeasteye.net/news/eid-2025-does-saudi-arabia-report-impossible-moonsightings

Here's an example image of a crescent sighting done with this method:

https://x.com/MulhamH/status/1927472335562375426

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That article literally says that their observation claim is BS because they've claimed impossible sightings.

Yet astronomers say it will be impossible to see the moon - even with optical aid, such as telescopes - on Saturday.

prominent Kuwaiti astronomer Adel al-Saadoun declared that it was “impossible to see the crescent this evening” in the Arabian Peninsula.

Last year, in 2024, Saudi Arabia announced on 6 June that Eid ul-Adha (the second Eid of the year) would commence in ten days after the new crescent moon for the month of Dhu al-Hijjah was sighted.

That was despite astronomical bodies insisting it was impossible for the moon to have been sighted.

The UAE-based International Astronomy Centre has likewise explained that in the Middle East it will be impossible to see the crescent on Saturday, even with new technology.

It also clearly states that UAQ is a calculated calendar.

Saudi Arabia uses a calendar called the Umm al-Qura, which is based on calculations and marks key dates years in advance.

“Turkey’s calendar is pre-calculated and their formula is more or less the same as Saudi Arabia’s,” Ahmed explained.

“But they’re transparent. They don’t claim they've seen the moon, like Saudi do. They're clear about what their formula is.”

I don't think we should echo SA's scientifically dubious claims and just state UAQ as what it is.

Copy link
Member Author

@sffc sffc Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, fair point. I changed it to: "The primary exception is Saudi Arabia, where the KACST publishes official predictions of crescent timings for multiple centuries."

Moved to #7330

/// make the observations more reliable. They publish predictions covering multiple centuries;
/// see [`UmmAlQura`].
///
/// # Calendar drift
///
/// As a lunar calendar, this calendar does not intend to follow the solar year, and drifts more
Expand Down Expand Up @@ -129,19 +142,27 @@ pub trait Rules: Clone + Debug + crate::cal::scaffold::UnstableSealed {

/// [`Hijri`] [`Rules`] based on an astronomical simulation for a particular location.
///
/// These simulations are unofficial and are known to not necessarily match sightings
/// on the ground. Unless you know otherwise for sure, instead of this variant, use
/// [`UmmAlQura`], which uses the results of KACST's Mecca-based calculations.
/// If your goal is to match ground truth in Saudi Arabia, use [`UmmAlQura`] instead.
///
/// As floating point arithmetic degenerates for far-away dates, this falls back to
/// the tabular calendar at some point.
/// These rules are based on calculations of the Earth, moon, and sun along with the
/// Shaukat criterion to determine crescent moon visibility.[^1]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change removes the remark "These simulations are unofficial and are known to not necessarily match sightings on the ground." and instead name drops "Shaukat criterion".

To a reader unfamiliar with the topic who is delegating to ICU4X for i18n expertise, this gives appearance of more gravitas (than before this PR) to this variant, which isn't the direction that we should be going in as long as we don't have evidence that this unofficial simulation serves user needs better than sticking to KACST's calculation that has official status.

///
/// These rules can form the basis of a custom [`Rules`] implementation that includes
/// crescent sighting adjustments. As discussed in the [`Hijri`] documentation, using these
/// rules without allowing such adjustments will produce dates that are only approximations
/// of the ground truth.
///
/// The simulations are pre-computed for Gregorian years 1900 to 2140, falling back to
/// a tabular approximation outside that range.
///
/// The precise behavior of this calendar may change in the future if:
/// - We decide to tweak the precise astronomical simulation used
/// - We decide to expand or reduce the range where we are using the astronomical simulation.
///
/// This corresponds to the `"islamic-rgsa"` [CLDR calendar](https://unicode.org/reports/tr35/#UnicodeCalendarIdentifier)
/// if constructed with [`Hijri::new_simulated_mecca()`].
///
/// [^1]: See [calendrical_calculations::islamic::observational_islamic_from_fixed]
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub struct AstronomicalSimulation {
pub(crate) location: SimulatedLocation,
Expand Down
6 changes: 6 additions & 0 deletions utils/calendrical_calculations/src/islamic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,13 @@ pub fn fixed_from_observational_islamic(
- 1
}

/// Calculates an Islamic date from a [`RataDie`] and [`Location`].
///
/// This uses the phasis criterion proposed by S. K. Shaukat[^1], explained in Reingold section 14.9.
///
/// Lisp code reference: <https://github.com/EdReingold/calendar-code2/blob/1ee51ecfaae6f856b0d7de3e36e9042100b4f424/calendar.l#L6983-L6995>
///
/// [^1]: K. Abdali, O. Afzal, I. A. Ahmad, M. Durrani, A. Salama, and S. K. Shaukat, “Crescent Moon Visibility: Consensus on Moon-Sighting and Determination of an Islamic Calendar,” manuscript, 1996.
pub fn observational_islamic_from_fixed(date: RataDie, location: Location) -> (i32, u8, u8) {
let lunar_phase = Astronomical::calculate_new_moon_at_or_before(date);
let crescent = Astronomical::phasis_on_or_before(date, location, Some(lunar_phase));
Expand Down
Loading