-
Notifications
You must be signed in to change notification settings - Fork 24
I am getting both the holiday AND the substitute day #46
Copy link
Copy link
Open
Labels
Description
Hi, I might be missing something.
Jan 1st, 2022 is Saturday. The rule is "01-01 and if saturday,sunday then next monday" so the holiday is actually on Jan 3rd.
However, the following code returns BOTH the Saturday AND the Monday as items 0 and 1 in the hols array and the isHoliday(hols[0].start) returns Jan 1st as being the holiday.
const holsObj = new Holidays('AU', 'NSW')
const hols = holsObj.getHolidays('2022')
const isHol = holsObj.isHoliday(hols[0].start) Using year 2025, where Jan 1st on Wednesday, it only returns the one date, as expected.
Is there a way to get the actual holiday applicable in that year?
Thanks for a great library,
Murray
Reactions are currently unavailable