Skip to content

Update Saudi Arabia calendar: Founding Day and Eid Al-Adha through 2029 - #2688

Open
PureSaber wants to merge 1 commit into
lballabio:masterfrom
PureSaber:fix/saudiarabia-founding-day-eid-adha
Open

Update Saudi Arabia calendar: Founding Day and Eid Al-Adha through 2029#2688
PureSaber wants to merge 1 commit into
lballabio:masterfrom
PureSaber:fix/saudiarabia-founding-day-eid-adha

Conversation

@PureSaber

@PureSaber PureSaber commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add Founding Day (22 Feb from 2022; 23 Feb 2025 per exchange calendar).
  • Extend Eid Al-Adha Gregorian anchor dates through 2029 using the existing Eid-1..Eid+4 window convention.
  • Include <vector> and refresh header docs (weekend change in 2013, Founding Day, exchange URL).

Source: Saudi Exchange holiday calendar.

Test plan

  • CI calendar suite
  • Spot-check Founding Day 2024-02-22 and 2026-02-22 are holidays; sample Eid Al-Adha 2026 window days are holidays.

Made with Cursor

@CLAassistant

CLAassistant commented Jul 28, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 74.896% (-0.002%) from 74.898% — PureSaber:fix/saudiarabia-founding-day-eid-adha into lballabio:master

Comment on lines +83 to +84
// Approximate Gregorian Eid al-Adha dates; holiday window Eid-1..Eid+4
// as used historically for Tadawul (see Saudi Exchange holiday calendar).

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Instead of using an approximation, we could change the code here so that the dates are correct. I'd suggest something like

static std::vector<std::pair<Date,Date>> EidAlAdha = {
    {Date(6, April, 1998),Date(11, April, 1998)},
    {Date(26, March, 1999),Date(31, March, 1999)},
    ...
};
return std::any_of(EidAlAdha.begin(), EidAlAdha.end(),
                               [=](auto p) { return d >= p.first && d <= p.second; });

What do you think?

Comment on lines +167 to +168
|| (d == 22 && m == February && y >= 2022 && y != 2025)
|| (d == 23 && m == February && y == 2025)

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

If the rule is that the holiday rolls on the next Sunday when it falls on a Friday or a Saturday, you can write it as a generic rule instead of maintaining the present and future exceptions such as 2025:

            || ((d == 22 || ((d == 23 || d == 24) && w == Sunday)) && m == February && y >= 2022)

You'll have to add Weekday w = date.weekday(); at the beginning of the method.

I would also add a short test case for this.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants