Skip to content

fix(TZ,ZW,AI,BS): four holidays that fall on the wrong day - #735

Merged
commenthol merged 4 commits into
commenthol:masterfrom
QuantIntellect:fix/relative-holiday-dates
Nov 29, 2026
Merged

commenthol merged 4 commits into
commenthol:masterfrom
QuantIntellect:fix/relative-holiday-dates

Conversation

@QuantIntellect

Copy link
Copy Markdown
Contributor

Four rules put a holiday on the wrong day. I found them by comparing the public holidays of every country that both date-holidays and python-holidays cover for 2015–2027, then checked each one against official sources.

TZ – Zanzibar Revolution Day and Boxing Day

01-02 → 01-12. The schedule of the Public Holidays Act (Cap. 35 R.E. 2023) lists "Revolution Day-12th January", the anniversary of the 1964 revolution. The same schedule lists "Boxing Day-26th December", but 12-26 used the 12-25 name, so December 26 showed up as a second "Christmas Day". It now uses the 12-26 name.

ZW – Defence Forces Day

2nd tuesday in August → tuesday after 2nd monday in August. When August 1 is a Tuesday, the 2nd Tuesday comes before Heroes' Day (the 2nd Monday). General Notice 244 of 2016 lists Heroes' Day on Monday 14 August 2017 and Defence Forces National Day on Tuesday 15 August 2017. The data had 8 August. This changes 2017, 2023 and 2028.

AI – August Thursday and Constitution Day

1st thursday in August → thursday after 1st monday in August, and 1st friday in August → friday after 1st monday in August. The Government of Anguilla's holiday lists put both days after August Monday:

year August Monday August Thursday Constitution Day data before (Thursday, Friday)
2017 7 Aug 10 Aug 11 Aug 3 and 4 Aug
2019 5 Aug 8 Aug 9 Aug 1 and 2 Aug
2024 5 Aug 8 Aug 9 Aug 1 and 2 Aug
2025 4 Aug 7 Aug 8 Aug 7 and 1 Aug

This changes every year in which August 1 falls on a Tuesday to Friday.

BS – National Heroes' Day

National Heroes' Day replaced Discovery Day (October 12) in October 2013, first on Monday 14 October 2013. It is held on the second Monday in October. The Bahamas High Commission in London listed it on Monday 8 October 2018, where the data had Friday 12 October, and the BISX 2021 trading calendar closes on Monday 11 October 2021, where the data had Tuesday 12 October. The rule is now 2nd monday in October since 2013. The October 12 rule applies only before 2013, under the name Discovery Day, so 2013 now has a single entry on October 14.

I also added these sources as @source lines in the four files.

Tests

Regenerated the TZ, ZW, AI and BS 2015–2029 fixtures with mocha test/all.mocha.js --writetests -c TZ,ZW,AI,BS. With TEST_XXL=1 and TZ=UTC, as in CI, the new fixtures fail with the old data (60 failing) and pass with the new data (60 passing). The full mocha run gives 9420 passing and 90 failing, and all 90 failures are CK-* fixtures. Their file names differ only in case, so they clash on my macOS checkout, and master fails the same 90. npx eslint and commitlint are clean.

The schedule of the Public Holidays Act (Cap. 35 R.E. 2023) lists
"Revolution Day-12th January" and "Boxing Day-26th December". The data
had Zanzibar Revolution Day on January 2, and December 26 used the
Christmas Day name.
When August 1 is a Tuesday, the 2nd Tuesday in August comes before
Heroes' Day (2nd Monday). General Notice 244 of 2016 lists Heroes' Day
on Monday 14 August 2017 and Defence Forces National Day on Tuesday
15 August 2017. Changes 2017, 2023 and 2028.
The Government of Anguilla lists both after August Monday (the first
Monday in August), e.g. 7, 10 and 11 August 2017 and 4, 7 and 8 August
2025. The 1st Thursday in August comes before August Monday when
August 1 is a Tuesday, Wednesday or Thursday, and the 1st Friday does
when August 1 is a Tuesday to Friday.
National Heroes' Day replaced Discovery Day (October 12) in October 2013
and is held on the second Monday in October: the Bahamas High Commission
in London listed it on Monday 8 October 2018, and the BISX trading
calendar on Monday 11 October 2021. Discovery Day keeps the October 12
rule before 2013.
@commenthol
commenthol merged commit 6b5b748 into commenthol:master Nov 29, 2026
2 checks passed
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.

2 participants