Skip to content

Conversation

tonyjoblin
Copy link

@tonyjoblin tonyjoblin commented Sep 29, 2025

Updates to ANZAC day definitions for 2026

Part of ENG-2028

Source of truth Fair Work Public Holidays

Important

Should be reviewed with related PR in the holidays project

Testing

For testing compare the above doc to what is in the definition file.

Checkout the project, run bundle install and then run make test. This runs some tests on the code in this project and some validations on the structure of the definitions file.

The definitions file does have a section on tests which define tests for the holiday definitions. These tests are used to generate test code that is run in the holidays project. You need to also review that project and follow the testing steps there.

@tonyjoblin tonyjoblin self-assigned this Sep 29, 2025
@tonyjoblin tonyjoblin added the bug label Sep 29, 2025
au.yaml Outdated
mday: 25
function: to_monday_if_weekend(date)
year_ranges:
- before: 2025
Copy link
Author

Choose a reason for hiding this comment

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

Basically in the past, if the holiday was on the weekend people also got the Monday as a holiday. That appears to have been stopped except for WA.

And some refactoring and fixes to the anzac day test
cases.
@tonyjoblin tonyjoblin changed the title Au anzac day 2026 Australia ANZAC Day 2026 Changes Oct 8, 2025
au.yaml Outdated
regions: [au_nsw, au_sa, au_tas, au_vic, au_act, au_wa, au_qld, au_nt]
mday: 25
year_ranges:
- after: 2026
Copy link
Author

@tonyjoblin tonyjoblin Oct 8, 2025

Choose a reason for hiding this comment

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

Going forward every state has ANZAC Day on the 25th. See https://www.fairwork.gov.au/employment-conditions/public-holidays/2026-public-holidays

au.yaml Outdated
regions: [au_wa]
mday: 25
function: additional_anzac_on_monday_if_on_weekend(date)
function: to_monday_if_weekend(date)
Copy link
Author

Choose a reason for hiding this comment

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

Moving forward only WA gets the additional holiday on the Monday when ANZAC day is on a weekend

date: '2026-04-27'
regions: ["au_nsw", "au_act", "au_vic", "au_tas", "au_sa", "au_nt", "au_qld"]
expect:
holiday: false
Copy link
Author

Choose a reason for hiding this comment

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

All the ANZAC day tests are consolidated in one section here. Some of these are just documenting the existing behaviour. Some new tests document the 2025 to 2026+ changes.

regions: ["au_qld"]
expect:
name: 'Additional public holiday for Boxing Day'
name: 'Additional public holiday Boxing Day'
Copy link
Author

Choose a reason for hiding this comment

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

The remaining changes are just "making the tests pass". These tests do not seem to have been maintained and I don't think get run in any pipeline. Note that there are no corresponding holiday definition changes. These changes are just purely getting the tests to pass with the existing definitions.

Note that the tests are only run against the definitions in the related holidays project. If you run the AU tests there then they all pass with these changes.

class InvalidMonth < Error; end
class InvalidMethod < Error; end
class InvalidRegions < Error; end
class MissingDateSpecification < Error; end
Copy link
Author

Choose a reason for hiding this comment

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

A bit of a side quest. While trying to debug my changes I thought I had a need for an additional validation on the definitions. Turns out it was user error. But its here now so...

Moves to Monday if falls on Sunday. Discovered after I
googled it. Added tests out to 2035. Some refactoring of
the definition file.
This function only provides the holiday on Monday if the
date is on the weekend. The problem with to_monday_if_weekend is
that you end up with two holidays on the same date.
@tonyjoblin tonyjoblin requested a review from gpramvr October 9, 2025 04:42
@tonyjoblin tonyjoblin merged commit c37bd54 into master Oct 9, 2025
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