We have a timezone system based in different customers within the same codebase. Each customer has its timezone set against itself and we use it together with moment-timezone to deal with their correct and exact time and days (start of, end of and exactly time for each time).
The issue happens when the holiday and the timezone offsets the zulu time per one day, e.g.:
checking if 01-01-2018 is a holiday
in australia timezone this day is 2017-12-31T13:00:00.000Z
when using hd.isHoliday it uses const year = toYear(date); which returns 2017
thus, it gets the holidays set from 2017 which ends up in not being a holiday, once there is no data where the given date is => startDate or < endDate (according from the excerpt of the code)
if (hd[j] && date >= hd[j].start && date < hd[j].end)
In other words, given:
const hd = new Holidays('AU');
const holiday = hd.isHoliday(new Date("2017-12-31T13:00:00.000Z"));
Hello,
We have a timezone system based in different customers within the same codebase. Each customer has its timezone set against itself and we use it together with moment-timezone to deal with their correct and exact time and days (start of, end of and exactly time for each time).
The issue happens when the holiday and the timezone offsets the zulu time per one day, e.g.:
01-01-2018
is a holiday2017-12-31T13:00:00.000Z
const year = toYear(date);
which returns 2017In other words, given:
holiday should be
However it's returning that this is not a holiday.