Skip to content

Commit

Permalink
Australia - Fix King's Birthday Queensland (#549)
Browse files Browse the repository at this point in the history
  • Loading branch information
tinohager authored Oct 10, 2023
1 parent d15cfce commit 8c18888
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
12 changes: 9 additions & 3 deletions src/Nager.Date/PublicHolidays/AustraliaProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public IEnumerable<PublicHoliday> 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);
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit 8c18888

Please sign in to comment.