Yes, that's a good point, the loop isn't very elegant. Personally I still like to anchor things at the beginning or end of the month, so I might write:
my $dt = DateTime->new(year=>$year, month=>11); $dt->add( days=>(4-$dt->dow())%7, weeks=>3 );
(But that's just getting nitpicky ;-) )
In reply to Re^3: Calculating holidays
by haukex
in thread Calculating holidays
by htmanning
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |