diff --git a/exchange_calendars/exchange_calendar_xsau.py b/exchange_calendars/exchange_calendar_xsau.py index 9df30eab..00625201 100644 --- a/exchange_calendars/exchange_calendar_xsau.py +++ b/exchange_calendars/exchange_calendar_xsau.py @@ -4,6 +4,7 @@ import pandas as pd from pandas.tseries.holiday import Holiday +import numpy as np # for concatenate from exchange_calendars.exchange_calendar import ExchangeCalendar, HolidayCalendar @@ -11,58 +12,22 @@ NationalDayOfSaudiArabia = Holiday("National Day of Saudi Arabia", month=9, day=23) -EidAlAdhaHoliday = pd.to_datetime( +# https://www.saudiexchange.sa/wps/portal/saudiexchange/about-saudi-exchange/exchange-media-centre/saudi-exchange-holiday-calendar?locale=en +EidAlAdhaHoliday = pd.to_datetime(np.concatenate( [ - "2023-06-27", - "2023-06-28", - "2023-06-29", - "2023-06-30", - "2023-07-01", - "2023-07-02", - "2022-07-07", - "2022-07-08", - "2022-07-09", - "2022-07-10", - "2022-07-11", - "2022-07-12", - "2022-07-13", - "2021-07-16", - "2021-07-17", - "2021-07-18", - "2021-07-19", - "2021-07-20", - "2021-07-21", - "2021-07-22", - ] -) - -EidAlFiterHoliday = pd.to_datetime( + pd.date_range('2024-06-13', '2024-06-23'), + pd.date_range('2023-06-27', '2023-07-02'), + pd.date_range('2022-07-07', '2022-07-13'), + pd.date_range('2021-07-16', '2021-07-22') + ])) + +EidAlFiterHoliday = pd.to_datetime(np.concatenate( [ - "2023-04-18", - "2023-04-19", - "2023-04-20", - "2023-04-21", - "2023-04-22", - "2023-04-23", - "2023-04-24", - "2023-04-25", - "2022-04-28", - "2022-04-29", - "2022-04-30", - "2022-05-01", - "2022-05-02", - "2022-05-03", - "2022-05-04", - "2022-05-05", - "2022-05-06", - "2022-05-07", - "2022-05-08", - "2021-05-13", - "2021-05-14", - "2021-05-15", - "2021-05-16", - ] -) + pd.date_range('2024-04-05', '2024-04-15'), + pd.date_range('2023-04-18', '2023-04-25'), + pd.date_range('2022-04-28', '2022-05-08'), + pd.date_range('2021-05-13', '2021-05-16') + ])) class XSAUExchangeCalendar(ExchangeCalendar): @@ -92,7 +57,7 @@ def _bound_min_error_msg(self, start: pd.Timestamp) -> str: @classmethod def bound_max(cls) -> pd.Timestamp: - return pd.Timestamp("2023-12-31") + return pd.Timestamp("2024-12-31") def _bound_max_error_msg(self, end: pd.Timestamp) -> str: msg = super()._bound_min_error_msg(end)