fix: correct Ramadan day count for countries with different moon sighting dates#32
Open
taham8875 wants to merge 1 commit intoahmadawais:mainfrom
Open
fix: correct Ramadan day count for countries with different moon sighting dates#32taham8875 wants to merge 1 commit intoahmadawais:mainfrom
taham8875 wants to merge 1 commit intoahmadawais:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The aladhan.com API uses a computational Hijri calendar that started Ramadan 1447 on Feb 18 for all locations. In reality, ~20+ countries (Egypt, Turkey, Pakistan, India, etc.) officially started on Feb 19 based on moon sighting. This caused the CLI to show the wrong Ramadan day for those countries.
Before / After
Egypt (started Feb 19) — before:
Egypt — after:
Saudi Arabia (started Feb 18) — unchanged:
How it works
recommendations.tsstores verified Ramadan start dates per country per Hijri year (1447).getRozaNumberFromStartDatedate arithmetic.--first-roza-datealways takes priority.Sources for country dates
Test plan
pnpm test— all 38 existing tests passramadan-cli "Cairo, Egypt"→ Roza 5, 5 Ramaḍān 1447ramadan-cli "Riyadh, Saudi Arabia"→ Roza 6, 6 Ramaḍān 1447ramadan-cli "Lahore, Pakistan"→ Roza 5ramadan-cli "Istanbul, Turkey"→ Roza 5ramadan-cli "Dubai, UAE"→ Roza 6