Skip to content
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

feat: add Norfolk Island #294

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open

Conversation

svict4
Copy link
Contributor

@svict4 svict4 commented Nov 25, 2021

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.

  • fix Sovereign’s Birthday if already Bounty Day
  • add tests

@svict4
Copy link
Contributor Author

svict4 commented Nov 25, 2021

@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

@commenthol
Copy link
Owner

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?

@svict4
Copy link
Contributor Author

svict4 commented Jan 1, 2022

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"

@commenthol
Copy link
Owner

Hi @svict4,
At commenthol/date-holidays-parser#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" .

@svict4
Copy link
Contributor Author

svict4 commented Jan 4, 2022

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 🙂

@svict4 svict4 marked this pull request as ready for review January 6, 2022 00:16
@svict4
Copy link
Contributor Author

svict4 commented Jan 6, 2022

Is there a way I can trigger the CI? @commenthol
Looks like travis didn't pick up that I published this draft PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants