Open bigbizze opened 1 month ago
Faced similar issue when tried to call destructured method returned from Holidays()
constructor:
const { isHoliday } = new Holidays('US');
isHoliday(new Date(value));
Error:
Cannot read properties of undefined (reading '__timezone')
TypeError: Cannot read properties of undefined (reading '__timezone')
at isHoliday (http://localhost:3000/static/js/bundle.js:424791:31)
...
Correct usage:
const holidays = new Holidays('US');
holidays.isHoliday(new Date(value));
There might be a binding issue somewhere in date-holidays
code I guess.
I am not sure what is causing this issue, I'm assuming it's some dependency thing between
date-holidays
,date-holidays-parser
,moment-timezone
andmoment
.I have my resolutions set to:
and i am using
date-holidays@3.23.12
date-holidays-parser issue: https://github.com/commenthol/date-holidays-parser/issues/59 moment-timezone issue: https://github.com/moment/moment-timezone/issues/1122 moment issue: https://github.com/moment/moment/issues/6259