Sweden has every Sunday as a holiday.

This commit is contained in:
Edward Betts 2025-02-12 08:52:18 -05:00
parent c9e7f4c61a
commit c8eca13d68

View file

@ -85,6 +85,10 @@ def get_holidays(country: str, start_date: date, end_date: date) -> list[Holiday
holiday_country = getattr(holidays, uc_country)
default_language = holiday_country.default_language
def skip_holiday(holiday_name: str) -> bool:
"""Skip holiday."""
return country == "se" and holiday_name == "Sunday"
for year in range(start_date.year, end_date.year + 1):
en_hols = holidays.country_holidays(uc_country, years=year, language="en_US")
local_lang = holidays.country_holidays(
@ -98,7 +102,7 @@ def get_holidays(country: str, start_date: date, end_date: date) -> list[Holiday
country=country.lower(),
)
for hol_date, title in en_hols.items()
if start_date <= hol_date <= end_date
if start_date <= hol_date <= end_date and not skip_holiday(title)
]
return found