Skip to content

Commit

Permalink
Fixed error
Browse files Browse the repository at this point in the history
In order to update XMOS I used the code from XKRX calendar.
Error was raised if I used multiple periods for special
weekmasks.
  • Loading branch information
Michail Bugaev authored and gerrymanoim committed Feb 29, 2024
1 parent 604024b commit f7940e3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions exchange_calendars/pandas_extensions/offsets.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ def business_days(self, business_days):
for left, right in toolz.sliding_window(
2, toolz.concatv(self._business_days_index)
):
if right.left - left.right > pd.Timestamp(1, unit="D"):
if pd.Timestamp((right.left - left.right).days,
unit="D") > pd.Timestamp(1, unit="D"):
interval = pd.Interval(
left.right + pd.Timedelta(1, unit="D"),
right.left - pd.Timedelta(1, unit="D"),
Expand Down Expand Up @@ -165,7 +166,7 @@ def _apply(self, other):
bday, interval = self._custom_business_day_for(
other, remaining, is_edge=True, with_interval=True
)
result = bday.apply(other)
result = bday._apply(other)
return result
else:
return super().apply(other)
Expand Down

0 comments on commit f7940e3

Please sign in to comment.