benlaw has asked for the wisdom of the Perl Monks concerning the following question:
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.
Thanks a lotuse 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; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: question on Date::Calc's special holiday
by davidrw (Prior) on Feb 10, 2007 at 04:58 UTC |