+
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
cf02f56
Refine Washington's Birthday handling for US states
parkerbxyz Jul 14, 2025
f393815
Refine Washington's Birthday holiday logic by state
parkerbxyz Jul 14, 2025
1faec10
Expand excluded subdivisions in US holiday tests
parkerbxyz Jul 14, 2025
d4c4b71
Update Washington's Birthday holiday tests
parkerbxyz Jul 14, 2025
fe4a98a
Update snapshots
parkerbxyz Jul 14, 2025
ea6a34c
Update localization files
parkerbxyz Jul 14, 2025
1defdae
Unify Washington's Birthday naming for US holidays
parkerbxyz Jul 14, 2025
3f9cbd1
Fix misplaced code comment
parkerbxyz Jul 14, 2025
35e1ca5
Remove comments from state holiday list
parkerbxyz Jul 14, 2025
2e2c73b
Use dynamic holiday name for observed Washington's Birthday
parkerbxyz Jul 14, 2025
3f4b7a0
Refactor Delaware holiday logic for Presidents' Day
parkerbxyz Jul 14, 2025
11b5703
Add Washington's Birthday for DE before 1990
parkerbxyz Jul 14, 2025
dafe524
Remove code comments
parkerbxyz Jul 14, 2025
487d1c5
Merge branch 'dev' into fix-washingtons-birthday
parkerbxyz Jul 14, 2025
a96f0cc
Remove redundant year check
parkerbxyz Jul 15, 2025
507b4e6
Apply suggestions from code review
parkerbxyz Jul 15, 2025
ae005ca
Merge branch 'dev' into fix-washingtons-birthday
parkerbxyz Jul 15, 2025
0142ebf
Update holidays/countries/united_states.py
parkerbxyz Jul 16, 2025
5de617d
Fix argument order in _add_observed calls
parkerbxyz Jul 16, 2025
f47b914
Merge branch 'dev' into fix-washingtons-birthday
parkerbxyz Jul 16, 2025
2339a03
Merge branch 'dev' into fix-washingtons-birthday
parkerbxyz Aug 6, 2025
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
135 changes: 88 additions & 47 deletions holidays/countries/united_states.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,41 @@ def _populate_common(self, include_federal: bool = False):
# Washington's Birthday.
name = tr("Washington's Birthday")
if self._year >= 1971:
self._add_holiday_3rd_mon_of_feb(name)
excluded_subdivs = {
"AK",
"AL",
"AR",
"AZ",
"CA",
"CO",
"DE",
"HI",
"ID",
"IN",
"MD",
"MN",
"MT",
"NJ",
"NM",
"OH",
"OK",
"OR",
"PA",
"PR",
"SC",
"TN",
"TX",
"UT",
"VA",
"VI",
"VT",
"WA",
"WV",
"WY",
}

if self.subdiv not in excluded_subdivs:
self._add_holiday_3rd_mon_of_feb(name)
else:
dt = self._add_holiday_feb_22(name)
# B-112525 February 27th, 1953 32 COMP. GEN. 378.
Expand Down Expand Up @@ -388,43 +422,45 @@ def _populate_subdiv_holidays(self):
self._add_holiday_3rd_mon_of_jan(tr("Martin Luther King Jr. Day"))

if self._year >= 1879 and self.subdiv not in {
"AK",
"AL",
"AR",
"AZ",
"CA",
"CO",
"DE",
"FL",
"GA",
"HI",
"ID",
"IN",
"MD",
"MN",
"MT",
"NJ",
"NM",
"OH",
"OK",
"OR",
"PA",
"PR",
"SC",
"TN",
"TX",
"UT",
"VA",
"VI",
"VT",
"WA",
"WV",
"WY",
}:
# Washington's Birthday.
name = tr("Washington's Birthday")
if self._year >= 1971:
self._add_holiday_3rd_mon_of_feb(name)
if self.subdiv not in {
"AK",
"AZ",
"CA",
"CO",
"HI",
"ID",
"MD",
"MN",
"MT",
"NJ",
"OH",
"OK",
"OR",
"PA",
"PR",
"SC",
"TN",
"TX",
"UT",
"VA",
"VT",
"WA",
"WV",
"WY",
}:
self._add_holiday_3rd_mon_of_feb(name)
else:
self._add_holiday_feb_22(name)

Expand Down Expand Up @@ -495,13 +531,9 @@ def _populate_subdiv_al_public_holidays(self):
tr("Martin Luther King, Jr & Robert E. Lee's Birthday")
)

if self._year >= 1879:
if self._year >= 1971:
# George Washington & Thomas Jefferson's Birthday.
name = tr("George Washington & Thomas Jefferson's Birthday")
if self._year >= 1971:
self._add_holiday_3rd_mon_of_feb(name)
else:
self._add_holiday_feb_22(name)
self._add_holiday_3rd_mon_of_feb(tr("George Washington & Thomas Jefferson's Birthday"))

if self._year >= 1866:
# Confederate Memorial Day.
Expand Down Expand Up @@ -530,13 +562,11 @@ def _populate_subdiv_ar_public_holidays(self):
else tr("Dr. Martin Luther King Jr. and Robert E. Lee's Birthdays")
)

if self._year >= 1879:
# George Washington's Birthday and Daisy Gatson Bates Day.
name = tr("George Washington's Birthday and Daisy Gatson Bates Day")
if self._year >= 1971:
self._add_holiday_3rd_mon_of_feb(name)
else:
self._add_holiday_feb_22(name)
if self._year >= 1971:
self._add_holiday_3rd_mon_of_feb(
# George Washington's Birthday and Daisy Gatson Bates Day.
tr("George Washington's Birthday and Daisy Gatson Bates Day")
)

def _populate_subdiv_as_public_holidays(self):
if self._year >= 1901:
Expand Down Expand Up @@ -636,6 +666,15 @@ def _populate_subdiv_de_public_holidays(self):
# Good Friday.
self._add_good_friday(tr("Good Friday"))

if 1971 <= self._year <= 2009:
self._add_holiday_3rd_mon_of_feb(
# Presidents' Day.
tr("Presidents' Day")
if self._year >= 1990
# Washington's Birthday.
else tr("Washington's Birthday")
)

if self._year >= 2008 and self._year % 2 == 0:
# Election Day.
self._add_holiday_1_day_past_1st_mon_of_nov(tr("Election Day"))
Expand Down Expand Up @@ -685,11 +724,12 @@ def _populate_subdiv_ga_public_holidays(self):
else tr("Robert E. Lee's Birthday")
)

if self._year >= 1879:
self._add_holiday(
if self._year >= 1971:
self._add_observed(
self._christmas_day,
# Washington's Birthday.
tr("Washington's Birthday"),
self._get_observed_date(self._christmas_day, rule=GA_IN_WASHINGTON_BIRTHDAY),
name=tr("Washington's Birthday"),
rule=GA_IN_WASHINGTON_BIRTHDAY,
)

def _populate_subdiv_gu_public_holidays(self):
Expand Down Expand Up @@ -781,11 +821,12 @@ def _populate_subdiv_in_public_holidays(self):
# Lincoln's Birthday.
self._add_holiday_1_day_past_4th_thu_of_nov(tr("Lincoln's Birthday"))

if self._year >= 1879:
self._add_holiday(
if self._year >= 1971:
self._add_observed(
self._christmas_day,
# Washington's Birthday.
tr("Washington's Birthday"),
self._get_observed_date(self._christmas_day, rule=GA_IN_WASHINGTON_BIRTHDAY),
name=tr("Washington's Birthday"),
rule=GA_IN_WASHINGTON_BIRTHDAY,
)

def _populate_subdiv_ks_public_holidays(self):
Expand Down
Loading
Loading
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载