Skip to content

Add Hijri holy days timeline and reminders#6

Open
nasmans wants to merge 1 commit intomainfrom
codex/update-texts-in-holy-days.tsx
Open

Add Hijri holy days timeline and reminders#6
nasmans wants to merge 1 commit intomainfrom
codex/update-texts-in-holy-days.tsx

Conversation

@nasmans
Copy link
Copy Markdown
Owner

@nasmans nasmans commented Oct 29, 2025

Summary

  • add a Hijri utility that calculates Laylat al-Qadr nights (17/19/21 Ramadan) and reminder dates three days prior
  • refresh the holy days service, public home page, and dashboard to use the new naming and shared timeline component
  • introduce a Jest configuration and unit tests covering the Hijri calculations

Testing

  • npm test (fails: jest binary unavailable because dependencies could not be installed in the sandbox)

https://chatgpt.com/codex/tasks/task_b_690262c3093083289fedfb6b0c6c632d

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +79 to +83
occurrences.push({
...hijri,
gregorian: new Date(cursor.getTime()),
reminder: addDays(cursor, -3),
});
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Populate Hijri fields expected by timeline consumers

The occurrences pushed in getUpcomingHolyDays expose the Hijri day, month, and year under generic keys day, month, and year, but downstream code and tests read hijriDay, hijriMonth, and hijriYear. This leaves the timeline rendering undefined values and causes the unit tests that assert result.map(item => item.hijriDay) to fail. The objects returned here should either rename the fields or provide aliases so the expected properties exist.

Useful? React with 👍 / 👎.

Comment on lines +70 to +73
if (!targetMonth) {
if (hijri.day === HOLY_DAYS[0]) {
targetMonth = { ...hijri };
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Skip remaining holy nights when reference date is mid-Ramadan

The search for upcoming nights only initializes targetMonth once the loop encounters a day equal to HOLY_DAYS[0] (17 Ramadan). If the reference date is already after the 17th but before the 21st of the current Ramadan, targetMonth remains null until the loop reaches the next year’s Ramadan, so the function returns the following year’s 17/19/21 and never lists the still-upcoming 21 of the current cycle. Consider detecting that the reference date is already inside Ramadan and collecting the remaining nights without waiting for another 17.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant