Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Date::Manip Sunday Holidays

by u65 (Chaplain)
on Nov 27, 2015 at 22:33 UTC ( #1148736=note: print w/replies, xml ) Need Help??


in reply to Date::Manip Sunday Holidays

Off the top of my head that doesn't right, at least as far as US federal holidays. I believe those that fall on Saturday are observed on the preceding Friday (update: New Year's Day may be the exception).

Update: I think the first solution is correct: the first business day will fall on Tuesday when 1 January falls on Saturday, Sunday, or Monday.

Replies are listed 'Best First'.
Re^2: Date::Manip Sunday Holidays
by ksublondie (Friar) on Nov 27, 2015 at 22:42 UTC
    https://www.frbservices.org/holidayschedules/:

    "For holidays falling on Saturday, Federal Reserve Banks and Branches will be open the preceding Friday. For holidays falling on Sunday, all Federal Reserve Banks and Branches will be closed the following Monday. "

      Oops, my bad. Looks like a bug to me.

        In general, you probably don't want to include both the definition of New Years and New Years observed (though you can but you have to be careful of the ordering if you add both... this is talked about in the documentation on Date::Manip::Holidays).

        To define the true New Years, just add (to your holidays):

        Jan 1 = New Years

        To define an observed New Years (where you observe it on Friday Dec 31 if Jan 1 falls on Saturday, or on Mon Jan 2 if Jan 1 falls on a Sunday), use the following:

        1*1:0:1:0:0:0*DWD = New Year's Day

        NOTE: this is straight from the documentation on Date::Manip::Holidays which is a better source of information on defining holidays than the Date::Manip::Recur document.

        Other definitions are also possible, but these cover the most commonly desired definitions.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1148736]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (7)
As of 2021-05-11 16:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Perl 7 will be out ...





    Results (119 votes). Check out past polls.

    Notices?