date-holidays
date-holidays copied to clipboard
feat: add Norfolk Island
Norfolk Island is an external territory of Australia and votes for seats in the ACT, so I've added NF as a region of the ACT.
- [x] fix Sovereign’s Birthday if already Bounty Day
- [x] add tests
@commenthol One little quirk I'm unsure how to handle the following:
(g) Bounty Day—8 June and, if that day is a Saturday or Sunday, the next Monday; (h) Sovereign’s Birthday—the first Monday after the second Saturday in June or, if that Monday is observed as Bounty Day under paragraph (g), the next Monday;
It's as if I need a "not" condition on this: https://github.com/commenthol/date-holidays/blob/master/docs/specification.md#holiday-based-on-other-holidays-bridge-days
Hi @svit4,
Unfortunately there is no rule yet for "dynamic" bridge days as in your case. You describe the 2nd case to my knowledge which requires this behavior (CH-GL: Näfelser Fahrt would be the other one).
Would you mind adding a note like this here?
# TODO: needs new rule: "substitute 06-08 if Saturday, Sunday then next Monday if 2nd Monday in June then next Monday"
I was thinking that you can use the enable disable rule but it looks that there is a parser error which prevents evaluation to substitution days. Maybe you could create an issue in the parser project here.
The only thing (as a workaround) which comes to my mind would be setting hard dates. Albeit this will set 3 times Anniversary (Bounty) Day for those years.
like:
"2013-06-17":
name:
en: Anniversary (Bounty) Day (substitute day)
type: public
"2030-06-17":
name:
en: Anniversary (Bounty) Day (substitute day)
type: public
For "Queen's Birthday" I am wondering if acording to (h) the rule shouldn't be set to "2nd Saturday in June if Saturday then next Monday"? Would this apply to all Australian states/ regions?
I don't think "Bounty Day" is the issue, that should simply be:
06-08 and if saturday,sunday then next monday:
substitute: true
name:
en: Anniversary (Bounty) Day
type: public
For "Queen's Birthday" I am wondering if acording to (h) the rule shouldn't be set to "2nd Saturday in June if Saturday then next Monday"? Would this apply to all Australian states/ regions?
For whatever reason, every state/region dictates when they celebrate the sovereign's birthday.
The problem here is that that "Queen's Birthday" moves a further week if it is already a public holiday on "he first Monday after the second Saturday in June", which would be due to Bounty Day.
We need something like:
# TODO: needs new rule: "substitute 2nd monday in June if Saturday, Sunday then next Monday if 2nd Monday in June is 'Bounty Day' then next Monday"
or
# TODO: needs new rule: "substitute 2nd monday in June if Saturday, Sunday then next Monday if 2nd Monday in June is holiday then next Monday"
Hi @svict4, At https://github.com/commenthol/date-holidays-parser/pull/42 I have added a new rule which should allow you to solve the described issue with moving a holiday if there is already a holiday the same day. Please let me know if this can solve your issue with "Bounty Day" and "Queen's Birthday" .
Thanks @commenthol that works!
06-08 if saturday,sunday then next monday:
substitute: true
name:
en: Anniversary (Bounty) Day
type: public
monday after 2nd saturday in June if is public holiday then next monday:
substitute: true
name:
en: Queen's Birthday
http://www.norfolkisland.gov.nf/sites/default/files/docs/NIRC/Gazettes/2018_06_29%20Gazette%20No.%2026.pdf
{
"date": "2019-06-10 00:00:00",
"start": "2019-06-09T14:00:00.000Z",
"end": "2019-06-10T14:00:00.000Z",
"name": "Anniversary (Bounty) Day",
"type": "public",
"rule": "06-08 if saturday,sunday then next monday",
"_weekday": "Mon"
},
{
"date": "2019-06-17 00:00:00",
"start": "2019-06-16T14:00:00.000Z",
"end": "2019-06-17T14:00:00.000Z",
"name": "Queen's Birthday",
"type": "public",
"rule": "monday after 2nd saturday in June if is public holiday then next monday",
"_weekday": "Mon"
}
I'll fix up the tests and publish the PR soon 🙂
Is there a way I can trigger the CI? @commenthol Looks like travis didn't pick up that I published this draft PR