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 10, 2007 at 04:58 UTC