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