vacanza / python-holidays

Generate and work with holidays in Python
https://pypi.org/project/holidays
MIT License
1.39k stars 447 forks source link

Kings Birthday Australia Issue #1820

Closed TrialMaster closed 2 weeks ago

TrialMaster commented 3 weeks ago

Queensland and Western Australia do not observe Kings Birthday holiday in same month like the rest of the country. See below official public holiday sites from government.

Australia 2024 Public Holidays - https://www.fairwork.gov.au/employment-conditions/public-holidays/2024-public-holidays

Qld Government - https://www.qld.gov.au/recreation/travel/holidays/public

WA Government - https://www.commerce.wa.gov.au/labour-relations/public-holidays-western-australia

KJhellico commented 2 weeks ago

Python Holidays supports these differences: for Queensland it's 1st Monday of October, for Western Australia it's last Monday of September (with some years' exceptions). For example:

>>> from holidays.countries.australia import AU

>>> au_qld = AU(subdiv="QLD", years=(2023, 2024, 2025))
>>> au_qld.get_named("King's Birthday")
[datetime.date(2024, 10, 7), datetime.date(2025, 10, 6), datetime.date(2023, 10, 2)]

>>> au_wa = AU(subdiv="WA", years=(2024, 2025, 2026))
>>> au_wa.get_named("King's Birthday")
[datetime.date(2024, 9, 23), datetime.date(2025, 9, 29), datetime.date(2026, 9, 28)]

These dates correspond to official sources.

TrialMaster commented 2 weeks ago

Hi @KJhellico thank you for response, I have found out that Home Assistant update caused the issue. 2024.6.2 was released this morning and has now resolved the issue https://www.home-assistant.io/blog/2024/06/05/release-20246/#202462---june-11

Out of curiosity how did you pull a list of the holidays. That would be handy to review each year.

KJhellico commented 2 weeks ago

We try to keep up with the changes. User feedback helps us a lot with this.