Skip to content

I am getting both the holiday AND the substitute day #46

Description

@flowt-au

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions