Beefy Boxes and Bandwidth Generously Provided by pair Networks vroom
Perl Monk, Perl Meditation
 
PerlMonks  

question on Date::Calc's special holiday

by benlaw (Scribe)
on Feb 09, 2007 at 05:08 UTC ( [id://599183]=perlquestion: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.

benlaw has asked for the wisdom of the Perl Monks concerning the following question:

Hi monks, I would like to write a schdule job with Date::Calc's, I would like to request more examples on Holiday calculation without Date::Calc::Calendar. Since the list of holiday are different from the calendar profile.

I just take a looking for the example in the doc, but I don't know how to modify the code to fulfill the case.

use Date::Calc qw( Days_in_Month Add_Delta_Days Day_of_Week ); $day = Days_in_Month($year,$month); while (1) { while ($holiday[$year][$month][$day]) { ($year,$month,$day) = Add_Delta_Days($year,$month,$day, -1); } $dow = Day_of_Week($year,$month,$day); if ($dow > 5) { ($year,$month,$day) = Add_Delta_Days($year,$month,$day, 5-$dow); } else { last; } }
Thanks a lot

Replies are listed 'Best First'.
Re: question on Date::Calc's special holiday
by davidrw (Prior) on Feb 09, 2007 at 23:58 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://599183]
Approved by marto
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.