Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^7: Date::Manip Sunday Holidays

by SBECK (Hermit)
on Dec 01, 2015 at 17:40 UTC ( #1149051=note: print w/replies, xml ) Need Help??


in reply to Re^6: Date::Manip Sunday Holidays
in thread Date::Manip Sunday Holidays

In the next release (6.52 which should be released tomorrow after a bit more testing), you will be able to define New Years the way you are asking in a couple of ways:

# Saturday 1*1:0:1:0:0:0*NBD,BD1,IBD,FD1 = New Year's Day # Sunday (observed Monday) 1*1:0:1:0:0:0*NBD,BD1,NBD,FD2 = New Year's Day # M-F 1*1:0:1:0:0:0*IBD = New Year's Day

or

# Saturday 1*1:0:1:0:0:0*IW6 = New Year's Day # Sunday (observed Monday) 1*1:0:1:0:0:0*IW7,FD1 = New Year's Day # M-F 1*1:0:1:0:0:0*IBD = New Year's Day

It's important to name the holiday the same for all definitions.

Replies are listed 'Best First'.
Re^8: Date::Manip Sunday Holidays
by ksublondie (Friar) on Dec 01, 2015 at 20:05 UTC
    ...And since I have the ear of "The Man", just a thought: the ability to input a hash or array of holidays would be powerful. Maybe through the constructor or a routine parameter? Say for example, if I want to keep a table of holidays in my sql db, then they could be maintained by a user through a web interface instead of an admin in a config file. Then I could query the db and input those days into the date object. Not that I spend waaaaay too much time thinking about holidays or anything.

    Unless of course this functionality already exists and I missed it somewhere in the documentation dispite studying it for hours. If that's the case, then nevermind.

      I'll put it on my todo list. It's not a bad idea, and it wouldn't be too hard to implement.
Re^8: Date::Manip Sunday Holidays
by ksublondie (Friar) on Dec 01, 2015 at 19:08 UTC
    Simply beautiful.

    Do you know how many YEARS this has plagued me? Now I can set it once and never touch it again. Since every single date routine I do involves holiday handling, this is the primary reason I use this module for everything. Thank you!

Re^8: Date::Manip Sunday Holidays
by ksublondie (Friar) on Dec 02, 2015 at 19:19 UTC
    I was able to update the package on my Linux boxes and it's working perfectly. However, my Win2012 64bit ActiveState v5.20 ppm is only showing the latest available for Date::Manip is v6.50. Repository is set to http://ppm4.activestate.com/MSWin32-x64/5.20/2000/package.db.gz and showing a last check datetime of 12/2/2015 @ 13:11. Looking at the ActiveState, it's showing latest release is 6.52, but only 6.51 in the table.

    Any idea how long until it's ready for ppm?

    Sorry, I feel like I finally got my red rider bb gun for Christmas.

      Sorry... I do almost nothing on windows and don't have any idea how the flow from CPAN to PPM works. You'd be better off referring to an ActiveState group. Or there's docs for how to create your own from CPAN IIRC (I believe I did that years ago).

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (3)
As of 2020-10-20 01:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (208 votes). Check out past polls.

    Notices?