holidays / holidays

A collection of Ruby methods to deal with statutory and other holidays. You deserve a holiday!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NZ Nelson Anniversary

charlie-ablett opened this issue · comments

First off - thanks for your work on this awesome gem.

The NZ region file includes the Nelson Anniversary, but has the region as :nz_ak - which is Auckland (other end of the country, and has its own anniversary! - see here and here)

https://github.com/holidays/holidays/blob/master/data/nz.yaml#L42

The same goes for Taranaki, which is closer but still a separate region. According to the yml file, its anniversary also incorrectly falls under :nz_ak.

It's not clear which is the Nelson region - :nz_nl seems to be for Northland. I'd be happy to make a change to the data files themselves, but not confident I'd test them properly. Based on how I think things work, it might look something like:

2:
  - name: Nelson Anniversary Day
  regions: [nz_ne]
  mday: 1
  observed: closest_monday

and

3:
  - name: Taranaki Anniversary Day
  regions: [nz_ta]
  week: 2
  wday: 1
  observed: closest_monday

Thanks muchly!

Thank you for this! I have a few NZ coworkers and if they knew that this gem had incorrect holidays for their homeland I might get smacked. 😄

Let me take a look at this and see if I can understand the issue. I'll dig into those 'public holidays' links, they usually make things clear enough to me.

Thanks! :D

While attempting to implement this I think I've uncovered a bug in the date processing for observed holidays that fall at month end or month beginning. Based on my understanding the current logic won't allow for the 2017 Nelson's holiday. If you give 2017/1/30 (the correct date according to this) then it doesn't find it. I think I see the issue but I'll need to think about what I can do here.

I'm going to push up the definition updates that you specified but then open another issue to deal with the bug that I think I see. I'll roll that change in with the refactor branch I have, which I plan on merging soonish. The good news is that 2016 seems fine, it's just 2017 that I noticed the issue.

PR coming soon!

Here is the PR: #145

Can you please take a quick look and let me know if I messed anything up?

I went ahead and merged. If there are issues we can address them in a new PR. I am going to pull down these changes and try to fix the other issue that I opened in my refactor branch. Thanks again for taking the time to submit the issue!