From 8c18888d0dfb36826dd032e6ac2eaff4f7eb1162 Mon Sep 17 00:00:00 2001 From: Tino Hager Date: Tue, 10 Oct 2023 21:24:33 +0200 Subject: [PATCH] Australia - Fix King's Birthday Queensland (#549) --- CHANGELOG.md | 1 + src/Nager.Date/PublicHolidays/AustraliaProvider.cs | 12 +++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a1677143..b95482bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### Fixed - Japan - Fix Health and Sports Day +- Australia - Fix King's Birthday Queensland ## [1.45.0] - 2023-08-27 diff --git a/src/Nager.Date/PublicHolidays/AustraliaProvider.cs b/src/Nager.Date/PublicHolidays/AustraliaProvider.cs index 14fdbae3..8ad5b434 100644 --- a/src/Nager.Date/PublicHolidays/AustraliaProvider.cs +++ b/src/Nager.Date/PublicHolidays/AustraliaProvider.cs @@ -78,7 +78,7 @@ public IEnumerable GetHolidays(int year) items.AddRangeIfNotNull(this.LabourDay(year, countryCode)); items.AddIfNotNull(this.MourningForQueenElizabeth(year, countryCode)); - items.AddIfNotNull(this.MonarchBirthday(year, countryCode)); + items.AddRangeIfNotNull(this.MonarchBirthday(year, countryCode)); items.AddIfNotNull(this.EasterSunday(year, countryCode)); return items.OrderBy(o => o.Date); @@ -111,7 +111,7 @@ private PublicHoliday[] LabourDay(int year, CountryCode countryCode) }; } - private PublicHoliday MonarchBirthday(int year, CountryCode countryCode) + private PublicHoliday[] MonarchBirthday(int year, CountryCode countryCode) { var name = "Queen's Birthday"; if (year >= 2023) @@ -120,7 +120,13 @@ private PublicHoliday MonarchBirthday(int year, CountryCode countryCode) } var secondMondayInJune = DateSystem.FindDay(year, Month.June, DayOfWeek.Monday, Occurrence.Second); - return new PublicHoliday(secondMondayInJune, name, name, countryCode, null, new string[] { "AU-ACT", "AU-NSW", "AU-NT", "AU-SA", "AU-TAS", "AU-VIC" }); + var firstMondayInOctober = DateSystem.FindDay(year, Month.October, DayOfWeek.Monday, Occurrence.First); + + return new PublicHoliday[] + { + new PublicHoliday(secondMondayInJune, name, name, countryCode, null, new string[] { "AU-ACT", "AU-NSW", "AU-NT", "AU-SA", "AU-TAS", "AU-VIC" }), + new PublicHoliday(firstMondayInOctober, name, name, countryCode, null, new string[] { "AU-QLD" }) + }; } private PublicHoliday MourningForQueenElizabeth(int year, CountryCode countryCode)