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

Saint Andrew's day is a Bank Holiday in Scotland (but is listed as informal)

samstickland opened this issue · comments

Hi,

In gb.yaml St. Andrew's Day is incorrectly listed as informal:

  • name: St. Andrew's Day
    regions: [gb_sct]
    mday: 30
    type: informal
    observed: to_monday_if_weekend

This is now a Bank Holiday since 2007.

I'm not sure how to correct this, since dates prior to 2006 should still report informal.

Hi again @samstickland.

Yep, this is a known feature that we want to add: #33

I've recently been performing a large-scale refactor of this gem and so I'm just now in a position to actually address some of these enhancements.

As a stopgap, we had a similar situation for a holiday in Japan. One way is to create a custom method and put the logic in there, like so: https://github.com/holidays/holidays/blob/master/definitions/jp.yaml#L177-L181

I'm going to leave this open for a bit so we can discuss this solution if you would like.

Small update: we have a PR that is addresses year cutoffs for holidays. That should get us closer to a solution. It can be found here #162

Once it is merged (just waiting on updated tests) I will see if I can fix the gb_sct definitions using the new functionality.

Great, that's fantastic news!

2016-02-20 19:15 GMT+00:00 Phil Trimble notifications@github.com:

Small update: we have a PR that is addresses year cutoffs for holidays.
That should get us closer to a solution. It can be found here #162
#162

Once it is merged (just waiting on updated tests) I will see if I can fix
the gb_sct definitions using the new functionality.


Reply to this email directly or view it on GitHub
#161 (comment).

Sorry for the delay, I started working on this but then realized that my work on #144 being completed will make this all a lot easier. :-/

Once that is done this is next on my list.

Hi @samstickland! Thanks for being SO. PATIENT. with me as I worked through the other refactors. The fix in the end was pretty simple thanks to the work done by @ttwo32 and the refactoring for the internal workings for handling date modifying functions.

If you would be so kind please take a quick look at the PR (#189) and make sure that my tests make sense. If you're happy with it then I'll go ahead and merge it and get it out the door as a minor point release.

Thanks again!

Ah, excellent, thank you so much! I will check it out over the weekend.

S

2016-04-29 22:39 GMT+01:00 Phil Trimble notifications@github.com:

Hi @samstickland https://github.com/samstickland! Thanks for being SO.
PATIENT. with me as I worked through the other refactors. The fix in the
end was pretty simple thanks to the work done by @ttwo32
https://github.com/ttwo32 and the refactoring for the internal workings
for handling date modifying functions.

If you would be so kind please take a quick look at the PR (#189
#189) and make sure that my
tests make sense. If you're happy with it then I'll go ahead and merge it
and get it out the door as a minor point release.

Thanks again!


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#161 (comment)

Hi,

So it all looks OK to me, but I have just one question:

  • St. Andrew's Day is considered a formal bank holiday 2007 and later.

It should show up regardless of whether

  • :informal is specified

Does this mean that from 2007 St. Andrew's Day shows up if you search only
with informal?

S

2016-04-29 23:23 GMT+01:00 Sam Stickland sam@spacething.org:

Ah, excellent, thank you so much! I will check it out over the weekend.

S

2016-04-29 22:39 GMT+01:00 Phil Trimble notifications@github.com:

Hi @samstickland https://github.com/samstickland! Thanks for being SO.
PATIENT. with me as I worked through the other refactors. The fix in the
end was pretty simple thanks to the work done by @ttwo32
https://github.com/ttwo32 and the refactoring for the internal
workings for handling date modifying functions.

If you would be so kind please take a quick look at the PR (#189
#189) and make sure that my
tests make sense. If you're happy with it then I'll go ahead and merge it
and get it out the door as a minor point release.

Thanks again!


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#161 (comment)

No, sorry, I can see how the comment is not entirely clear. What it means is that St Andrew's Day will only show up as a holiday if :informal is specified from 2006 and earlier. It will show up in either case from 2007 on.

Anything marked as informal is ignored in normal gem usage. Think of the :informal flag as saying 'give me all formal holidays PLUS any informal holidays that fall on the specified date(s)'. It's telling the gem to give more results than it normally gives (i.e. send back anything marked as 'informal' as well when it usually ignores informal holidays by default).

Concrete example:

Holidays.on(Date.civil(2007,11,30)) <- returns St Andrews Day
Holidays.on(Date.civil(2007,11,30), :informal) <- returns St Andrews Day
Holidays.on(Date.civil(2006,11,30)) <- Does NOT return St Andrews Day
Holidays.on(Date.civil(2006,11,30), :informal) <- returns St Andrews Day

Hopefully that makes sense. 😕

Ah yes, that does make sense. Thanks!
El 5/5/2016 12:21 a. m., "Phil Trimble" notifications@github.com escribió:

No, sorry, I can see how the comment is not entirely clear. What it means
is that St Andrew's Day will only show up as a holiday if :informal is
specified from 2006 and earlier. It will show up in either case from 2007
on.

Anything marked as informal is ignored in normal gem usage. Think of the
:informal flag as saying 'give me all formal holidays PLUS any informal
holidays that fall on the specified date(s)'. It's telling the gem to give
more results than it normally gives (i.e. send back anything marked as
'informal' as well when it usually ignores informal holidays by default).

Concrete example:

Holidays.on(Date.civil(2007,11,30)) <- returns St Andrews DayHolidays.on(Date.civil(2007,11,30), :informal) <- returns St Andrews DayHolidays.on(Date.civil(2006,11,30)) <- Does NOT return St Andrews DayHolidays.on(Date.civil(2006,11,30), :informal) <- returns St Andrews Day

Hopefully that makes sense. 😕


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#161 (comment)

Cool, closing this out and merging! Thanks for taking the time to work through this with me.