Skip to content

Commit aa5dba5

Browse files
committed
BUG: Preserve tz of start_date in Holiday.dates
Previously, the timezone of only the start_date was lost, causing the subsequent call to `DatetimeIndex` to fail if a both start_date and end_date were tz-aware.
1 parent 10c933b commit aa5dba5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pandas/tseries/holiday.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,10 @@ def dates(self, start_date, end_date, return_name=False):
203203
end_date = Timestamp(end_date)
204204

205205
year_offset = DateOffset(years=1)
206-
base_date = Timestamp(datetime(start_date.year, self.month, self.day))
206+
base_date = Timestamp(
207+
datetime(start_date.year, self.month, self.day),
208+
tz=start_date.tz,
209+
)
207210
dates = DatetimeIndex(start=base_date, end=end_date, freq=year_offset)
208211
holiday_dates = self._apply_rule(dates)
209212
if self.days_of_week is not None:

0 commit comments

Comments
 (0)