Keep It Simple, Stupid | |
PerlMonks |
Date::Manip Sunday Holidaysby ksublondie (Friar) |
on Nov 27, 2015 at 22:10 UTC ( [id://1148735]=perlquestion: print w/replies, xml ) | Need Help?? |
ksublondie has asked for the wisdom of the Perl Monks concerning the following question:
I'm using Date::Manip to determine the next business day, taking holidays into account. My problem is business days are M-F, but observed holidays are the following day (Monday) if the holiday is a Sunday, however, if holidays land on a Saturday, they are still observed on that day. Following the documentation, I've tried in my holiday config file 1*1:0:1:0:0:0*NWD = New Years Day, but it lists BOTH Saturday and Sunday New Year days on the following Monday. I've also tried 1*1:0:2:0:0:0*WD2 = New Years Day, but it always picks the Monday of the week of Jan 2. Is there a way I can dynamically generate the correct observed holidays? I'm currently hard-coding these Sunday holidays every few years which is a perfect environment for screwing it up. CLARIFICATION: Holidays are to be observed on their usual date unless it falls on a Sunday. In this case, the holiday is observed the following Monday. In addition, Saturdays are never "business" days. EDIT: Monday Jan 2 = New Years Day (observed) is essentially what I need, but that syntax doesn't work.
Back to
Seekers of Perl Wisdom
|
|