Skip to content

Cocos (Keeling) Islands - Adjust holidays - #1183

Merged
tinohager merged 1 commit into
mainfrom
fix/cocos-keeling-islands-adjustments
Oct 28, 2026
Merged

tinohager merged 1 commit into
mainfrom
fix/cocos-keeling-islands-adjustments

Conversation

@tinohager

@tinohager tinohager commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

This pull request introduces comprehensive improvements to the handling and testing of public holidays for the Cocos (Keeling) Islands. The main changes include enhanced logic for holiday observation rules, the addition of special cases (notably for the Monarch's Birthday), and the introduction of a dedicated unit test class to verify holiday calculations. These updates ensure greater accuracy and maintainability of the holiday provider.

Enhancements to holiday observation logic:

  • Added multiple ObservedRuleSet configurations in CocosIslandsHolidayProvider to handle shifting holidays when they fall on weekends or overlap with other holidays, including a custom rule for Self Determination Day and a special case for the Monarch's Birthday in 2025 [1] [2] [3] [4].
  • Updated holiday specifications for New Year's Day, Australia Day, Self Determination Day, Anzac Day, Christmas Day, and St. Stephen's Day to use the new observed rules for correct date shifting [1] [2] [3] [4].

Special handling for Monarch's Birthday:

  • Refactored the logic for the Monarch's Birthday into a separate method, dynamically naming it "King's" or "Queen's" Birthday based on the year, and handling the 2025 special case where the date is shifted due to a conflict with Hari Raya Haji.

Testing improvements:

  • Added a new test class CocosIslandsTest with detailed test cases for all major public holidays, ensuring correct calculation and observation for years 2021–2027.

Documentation and source updates:

  • Expanded the list of official sources for Cocos (Keeling) Islands public holidays, improving traceability and data accuracy.

@tinohager
tinohager merged commit 7e075c1 into main Oct 28, 2026
1 check passed
@tinohager
tinohager deleted the fix/cocos-keeling-islands-adjustments branch October 28, 2026 22:00
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.

1 participant