Skip to content

Commit

Permalink
Updated XMAD calendar for New Years Eve 2021 holiday
Browse files Browse the repository at this point in the history
  • Loading branch information
philtromans committed Dec 6, 2021
1 parent 71e39aa commit bf2cc3a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
7 changes: 5 additions & 2 deletions exchange_calendars/exchange_calendar_xmad.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,10 @@
BoxingDay = boxing_day()

NewYearsEveThrough2010 = new_years_eve(end_date="2011")
NewYearsEveEarlyClose2012Onwards = new_years_eve(
NewYearsEveFrom2021 = new_years_eve(start_date="2021")
NewYearsEveEarlyClose2012To2020 = new_years_eve(
start_date="2012",
end_date="2021",
days_of_week=(WEEKDAYS),
)

Expand Down Expand Up @@ -134,6 +136,7 @@ def regular_holidays(self):
Christmas,
BoxingDay,
NewYearsEveThrough2010,
NewYearsEveFrom2021
]
)

Expand All @@ -145,7 +148,7 @@ def special_closes(self):
HolidayCalendar(
[
ChristmasEveEarlyClose2012To2020,
NewYearsEveEarlyClose2012Onwards,
NewYearsEveEarlyClose2012To2020,
]
),
)
Expand Down
1 change: 0 additions & 1 deletion tests/resources/xmad.csv
Original file line number Diff line number Diff line change
Expand Up @@ -8090,7 +8090,6 @@
2021-12-28T00:00:00Z,2021-12-28T08:00:00Z,2021-12-28T16:30:00Z,,
2021-12-29T00:00:00Z,2021-12-29T08:00:00Z,2021-12-29T16:30:00Z,,
2021-12-30T00:00:00Z,2021-12-30T08:00:00Z,2021-12-30T16:30:00Z,,
2021-12-31T00:00:00Z,2021-12-31T08:00:00Z,2021-12-31T13:00:00Z,,
2022-01-03T00:00:00Z,2022-01-03T08:00:00Z,2022-01-03T16:30:00Z,,
2022-01-04T00:00:00Z,2022-01-04T08:00:00Z,2022-01-04T16:30:00Z,,
2022-01-05T00:00:00Z,2022-01-05T08:00:00Z,2022-01-05T16:30:00Z,,
Expand Down
12 changes: 10 additions & 2 deletions tests/test_xmad_calendar.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ def regular_holidays_sample(self):
"2004-11-01", # All Saints Day
"2004-12-06", # Constitution Day
"2004-12-08", # Immaculate Conception
"2010-12-31", # New Year's Eve
#
# New Year's Eve was a holiday through to 2010, then became an early
# close, and then went back to being a full day's holiday from 2021.
"2010-12-31",
"2021-12-31"
]

@pytest.fixture
Expand Down Expand Up @@ -72,7 +76,11 @@ def non_holidays_sample(self):
"2005-11-01", # All Saints Day
"2005-12-06", # Constitution Day
"2005-12-08", # Immaculate Conception
"2012-12-31", # New Year's Eve

# New Year's Eve was holiday through to 2010, but then became an early
# close after that, before becoming a full market holiday again in 2021.
"2012-12-31",
"2020-12-31"
]

@pytest.fixture
Expand Down

0 comments on commit bf2cc3a

Please sign in to comment.