Skip to content

Commit

Permalink
Update Australia holidays: fix Sovereign's Birthday dates in WA (#1757)
Browse files Browse the repository at this point in the history
  • Loading branch information
KJhellico authored Apr 10, 2024
1 parent 5da68cb commit 894214c
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 5 deletions.
19 changes: 18 additions & 1 deletion holidays/countries/australia.py
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,19 @@ def _populate_subdiv_wa_public_holidays(self):
# Sovereign's Birthday.
if self._year >= 1936:
if self._year >= 1984:
self._add_holiday_last_mon_of_sep(self.sovereign_birthday)
# Celebration Day for the Anniversary of the Birthday of the Reigning Sovereign
# to be appointed for each year by proclamation published in the Government Gazette
sovereign_birthday_dates = {
2011: (OCT, 28),
2012: (OCT, 1),
2024: (SEP, 23),
}
if self._year in sovereign_birthday_dates:
self._add_holiday(
self.sovereign_birthday, sovereign_birthday_dates[self._year]
)
else:
self._add_holiday_last_mon_of_sep(self.sovereign_birthday)
else:
self._add_holiday_2nd_mon_of_oct(self.sovereign_birthday)

Expand Down Expand Up @@ -945,3 +957,8 @@ class AustraliaStaticHolidays:
2010: (DEC, 28, "Christmas Day"),
2011: (JAN, 3, "New Year's Day"),
}

special_wa_public_holidays = {
# In 2011 both ANZAC Day and Easter Monday fell on Monday 25 April.
2011: (APR, 26, "Special public holiday"),
}
7 changes: 4 additions & 3 deletions snapshots/countries/AU_WA.json
Original file line number Diff line number Diff line change
Expand Up @@ -658,8 +658,9 @@
"2011-03-07": "Labour Day",
"2011-04-22": "Good Friday",
"2011-04-25": "ANZAC Day; Easter Monday",
"2011-04-26": "Special public holiday",
"2011-06-06": "Foundation Day",
"2011-09-26": "Queen's Birthday",
"2011-10-28": "Queen's Birthday",
"2011-12-25": "Christmas Day",
"2011-12-26": "Boxing Day; Christmas Day (observed)",
"2011-12-27": "Boxing Day (observed)",
Expand All @@ -671,7 +672,7 @@
"2012-04-09": "Easter Monday",
"2012-04-25": "ANZAC Day",
"2012-06-04": "Western Australia Day",
"2012-09-24": "Queen's Birthday",
"2012-10-01": "Queen's Birthday",
"2012-12-25": "Christmas Day",
"2012-12-26": "Boxing Day",
"2013-01-01": "New Year's Day",
Expand Down Expand Up @@ -807,7 +808,7 @@
"2024-04-01": "Easter Monday",
"2024-04-25": "ANZAC Day",
"2024-06-03": "Western Australia Day",
"2024-09-30": "King's Birthday",
"2024-09-23": "King's Birthday",
"2024-12-25": "Christmas Day",
"2024-12-26": "Boxing Day",
"2025-01-01": "New Year's Day",
Expand Down
13 changes: 12 additions & 1 deletion tests/countries/test_australia.py
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,17 @@ def test_national_day_of_mourning_for_queen_elizabeth_II(self):
for holidays in self.subdiv_holidays.values():
self.assertHolidayName(name, holidays, dt)

def test_special_holidays(self):
act_holidays = self.subdiv_holidays["ACT"]
qld_holidays = self.subdiv_holidays["QLD"]
wa_holidays = self.subdiv_holidays["WA"]
self.assertHoliday(act_holidays, "2020-04-20", "2021-04-25")
self.assertHoliday(qld_holidays, "2010-12-28", "2011-01-03", "2012-06-11")
self.assertNoNonObservedHoliday(
Australia(subdiv="QLD", observed=False, years=(2010, 2011)), "2010-12-28", "2011-01-03"
)
self.assertHoliday(wa_holidays, "2011-04-26")

def test_all_holidays(self):
holidays_found = set()
for subdiv in Australia.subdivisions:
Expand Down Expand Up @@ -664,7 +675,7 @@ def test_holidays_2024(self):
(AUG, 5): {"NT"},
(AUG, 14): {"QLD"},
(SEP, 27): {"VIC"},
(SEP, 30): {"WA"},
(SEP, 23): {"WA"},
(OCT, 7): {"ACT", "NSW", "QLD", "SA"},
(NOV, 5): {"VIC"},
(DEC, 25): {"ACT", "NSW", "NT", "QLD", "SA", "TAS", "VIC", "WA"},
Expand Down

0 comments on commit 894214c

Please sign in to comment.