Coder Social home page Coder Social logo

Comments (10)

ppeble avatar ppeble commented on July 24, 2024 1

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!

from holidays.

ppeble avatar ppeble commented on July 24, 2024

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.

from holidays.

ppeble avatar ppeble commented on July 24, 2024

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.

from holidays.

samstickland avatar samstickland commented on July 24, 2024

Great, that's fantastic news!

2016-02-20 19:15 GMT+00:00 Phil Trimble [email protected]:

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).

from holidays.

ppeble avatar ppeble commented on July 24, 2024

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.

from holidays.

samstickland avatar samstickland commented on July 24, 2024

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 [email protected]:

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)

from holidays.

samstickland avatar samstickland commented on July 24, 2024

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 [email protected]:

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 [email protected]:

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)

from holidays.

ppeble avatar ppeble commented on July 24, 2024

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. πŸ˜•

from holidays.

samstickland avatar samstickland commented on July 24, 2024

Ah yes, that does make sense. Thanks!
El 5/5/2016 12:21 a. m., "Phil Trimble" [email protected] 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)

from holidays.

ppeble avatar ppeble commented on July 24, 2024

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

from holidays.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.