-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I am getting both the holiday AND the substitute day #46
Comments
Hi, |
Hi, and thanks for your quick reply. I agree people will celebrate on Jan 1st. :-) And generally only if they normally do not work on Saturdays. In Australia, with a highly casualised workforce, Saturdays are often normal work days. And yes, it depends upon what one means by "Public Holiday". Since the Public Holiday / Day off is, as the rules say, on Monday in 2022, it would be great to have an option that flags the "Day off" ie Monday, where the rules say that is a holiday. So for 2022/23 return both records as now, but Mon 3rd/2nd is flagged as the "day off" and in years where Jan 1st falls on a weekday, that Jan 1st would be flagged as the "day off". The timeanddate link you sent correctly identifies the Monday as a "Day off", so a flag on the returned record that indicated that would be really helpful and I can adjust the displayed text if there are 2 records depending on how I need to use it. I currently parse the returned records looking for "duplicates" and remove the redundant one, but since your functions are determining that anyway a boolean on the record would be simpler. Thanks again for your work and for your consideration, |
Hi @flowt-au, |
Thanks so much! That will simplify things on my side. :-) |
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.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
The text was updated successfully, but these errors were encountered: