Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Frances Xavier Cabrini Day for United States, Colorado #1995

Merged
merged 2 commits into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ repos:
rev: 1.7.9
hooks:
- id: bandit
additional_dependencies:
- bandit[toml]
args:
- --configfile=pyproject.toml

Expand Down
7 changes: 7 additions & 0 deletions holidays/countries/united_states.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ class UnitedStates(ObservedHolidayBase, ChristianHolidays, InternationalHolidays
- https://en.wikipedia.org/wiki/Indigenous_Peoples%27_Day_(United_States)
- https://www.sos.ri.gov/divisions/civics-and-education/reference-desk/ri-state-holidays
- https://web.archive.org/web/20080831103521/http://www.dpa.ca.gov/personnel-policies/holidays.htm

Frances Xavier Cabrini Day:
- https://leg.colorado.gov/sites/default/files/2020a_1031_signed.pdf
"""

country = "US"
Expand Down Expand Up @@ -325,6 +328,10 @@ def _populate_subdiv_co_public_holidays(self):
if self._year >= 2001:
self._add_holiday_mar_31("Cesar Chavez Day")

# Frances Xavier Cabrini Day
if self._year >= 2020:
self._add_holiday_1st_mon_of_oct("Frances Xavier Cabrini Day")

def _populate_subdiv_ct_public_holidays(self):
# Lincoln's Birthday
if self._year >= 1971:
Expand Down
17 changes: 17 additions & 0 deletions tests/countries/test_united_states.py
Original file line number Diff line number Diff line change
Expand Up @@ -1887,3 +1887,20 @@ def test_new_years_eve(self):
self.assertNoNonObservedHolidayName(
f"{name} (observed)", UnitedStates(subdiv=subdiv, observed=False), obs_dt
)

def test_frances_xavier_cabrini_day(self):
co_holidays = self.state_hols["CO"]
name = "Frances Xavier Cabrini Day"

self.assertNoHolidayName(name, co_holidays, range(2000, 2019))
self.assertHolidayName(name, co_holidays, range(2020, 2024))
self.assertHoliday(
co_holidays,
(
"2020-10-05",
"2021-10-04",
"2022-10-03",
"2023-10-02",
"2024-10-07",
),
)
Loading