Skip to content

Commit

Permalink
Update NYSE holidays: fix Juneteenth National Independence Day start …
Browse files Browse the repository at this point in the history
…year (#1484)
  • Loading branch information
KJhellico committed Sep 28, 2023
1 parent ec725f6 commit ec333ee
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 16 deletions.
5 changes: 3 additions & 2 deletions holidays/financial/ny_stock_exchange.py
Expand Up @@ -39,6 +39,7 @@ class NewYorkStockExchange(HolidayBase, ChristianHolidays, InternationalHolidays
- https://www.nyse.com/markets/hours-calendars
Historical data:
- s3.amazonaws.com/armstrongeconomics-wp/2013/07/NYSE-Closings.pdf
- https://web.archive.org/web/20211101162021/https://www.nyse.com/markets/hours-calendars
"""

market = "NYSE"
Expand Down Expand Up @@ -204,8 +205,8 @@ def _populate(self, year):
if 1916 <= year <= 1953:
self._add_observed_holiday("Flag Day", date(year, JUN, 14))

# JUNETEENTH: since 2021
if year >= 2021:
# JUNETEENTH: since 2022
if year >= 2022:
self._add_observed_holiday("Juneteenth National Independence Day", date(year, JUN, 19))

# INDEPENDENCE DAY (July 4) - history suggests closed every year
Expand Down
1 change: 0 additions & 1 deletion snapshots/financial/NYSE.json
Expand Up @@ -685,7 +685,6 @@
"2021-02-15": "Washington's Birthday",
"2021-04-02": "Good Friday",
"2021-05-31": "Memorial Day",
"2021-06-18": "Juneteenth National Independence Day (Observed)",
"2021-07-05": "Independence Day (Observed)",
"2021-09-06": "Labor Day",
"2021-11-25": "Thanksgiving Day",
Expand Down
1 change: 0 additions & 1 deletion snapshots/financial/XNYS.json
Expand Up @@ -685,7 +685,6 @@
"2021-02-15": "Washington's Birthday",
"2021-04-02": "Good Friday",
"2021-05-31": "Memorial Day",
"2021-06-18": "Juneteenth National Independence Day (Observed)",
"2021-07-05": "Independence Day (Observed)",
"2021-09-06": "Labor Day",
"2021-11-25": "Thanksgiving Day",
Expand Down
24 changes: 12 additions & 12 deletions tests/financial/test_ny_stock_exchange.py
Expand Up @@ -210,8 +210,8 @@ def test_flagday(self):

def test_juneteenth(self):
for dt in (
date(2021, JUN, 18),
date(2022, JUN, 20),
date(2023, JUN, 19),
):
self.assertHoliday(dt)
self.assertNoHoliday(dt + td(days=-1))
Expand All @@ -222,6 +222,7 @@ def test_juneteenth(self):
for dt in (
date(1954, JUN, 18),
date(1967, JUN, 19),
date(2021, JUN, 18),
):
self.assertNoHoliday(dt)

Expand Down Expand Up @@ -473,15 +474,14 @@ def _make_special_holiday_list(begin, end, days=None, weekends=False):

def test_all_modern_holidays_present(self):
self.assertHolidays(
("2021-01-01", "New Year's Day"),
("2021-01-18", "Martin Luther King Jr. Day"),
("2021-02-15", "Washington's Birthday"),
("2021-04-02", "Good Friday"),
("2021-05-31", "Memorial Day"),
("2021-06-18", "Juneteenth National Independence Day (Observed)"),
("2021-07-05", "Independence Day (Observed)"),
("2021-09-06", "Labor Day"),
("2021-11-25", "Thanksgiving Day"),
("2021-12-24", "Christmas Day (Observed)"),
("2021-12-31", "New Year's Day (Observed)"),
("2023-01-02", "New Year's Day (Observed)"),
("2023-01-16", "Martin Luther King Jr. Day"),
("2023-02-20", "Washington's Birthday"),
("2023-04-07", "Good Friday"),
("2023-05-29", "Memorial Day"),
("2023-06-19", "Juneteenth National Independence Day"),
("2023-07-04", "Independence Day"),
("2023-09-04", "Labor Day"),
("2023-11-23", "Thanksgiving Day"),
("2023-12-25", "Christmas Day"),
)

0 comments on commit ec333ee

Please sign in to comment.