Open garthompson opened 2 years ago
We experienced a similar issue and turns out that it was an inconsistency of tz. Each set of rules takes a tz info as argument and if not provided will do calculations in UTC. So, in your case you set your workdays in la_tz but not your holidays. Have you tried this?
us_holidays_rule = HolidayRule(UnitedStates(), tz= la_tz)
That solved the issue for us.
A simple test-case to reproduce this issue:
Notes:
November 10th is Columbus Day in the US, although not a federal holiday.
The holidays library, doesn’t recognise 2021-11-10 as a holiday in the US. 2021-11-11 is recognised as a holiday however - Veteran’s Day. It may be relevant that 1700 in LA is midnight in UTC.
Results are returned if the timezone is excluded.
Same issue arises on 2020-11-10
No issue with times < 1600 on 2021-11-10
Removing the us_holidays_rule from business hours resolves the issue
Other holidays also appear to create issues - all times tried on 2021-12-24 and 2021-12-25 errored.