vacanza / holidays

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

2024-08-26 should be a holiday in GB #1909

Closed mrgum closed 2 months ago

mrgum commented 2 months ago

Bug Report

Expected Behavior

2024-08-26 should be a holiday in GB

Actual Behavior

holidays does not treat it as a holiday

Steps to Reproduce the Problem

from datetime import datetime
import holidays

uk_holidays = holidays.GB()

if '2024-08-24' in uk_holidays:
    print("enjoy the day off work")

dateobj = datetime.strptime('2024-08-24', "%Y-%m-%d")

if dateobj in uk_holidays:
    print("enjoy the day off work")

should print but does not

Environment

Additional Context

https://www.gov.uk/bank-holidays

KJhellico commented 2 months ago

Summer Bank Holiday is relevant only to England, Wales and Northern Ireland, not whole UK. So if we want to see it, need to specify subdivision, e.g.

import holidays

uk_eng_holidays = holidays.GB(subdiv="ENG")  # or "WLS" or "NIR"

if "2024-08-26" in uk_eng_holidays:
    print("enjoy the day off work")
arkid15r commented 2 months ago

Closing this. @mrgum feel free to re-open if you need more help with this.

mrgum commented 2 months ago

Thank you!