Skip to content

Commit

Permalink
Add Frances Xavier Cabrini Day for United States, Colorado (#1995)
Browse files Browse the repository at this point in the history
Co-authored-by: Arkadii Yakovets <[email protected]>
  • Loading branch information
e2thenegpii and arkid15r committed Sep 16, 2024
1 parent 54a906c commit 1467e72
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
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",
),
)

0 comments on commit 1467e72

Please sign in to comment.