in reply to Re^2: Determing Week Ranges between given date range?
in thread Determing Week Ranges between given date range?
If you want the first day of the week to be something besides Sunday
He wants it to be Monday.
you can do this:
You have an off-by-one error.
my $first_dow = 1; # 0=Sun, 1=Mon, ..., 7=Sun ... # Day before first $first_dow after $week_s ->add( days => ((7 - $week_s->dow()) + ($first_dow + 6)) % 7 );
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: Determing Week Ranges between given date range?
by mojotoad (Monsignor) on Oct 12, 2010 at 21:54 UTC | |
by ikegami (Patriarch) on Oct 12, 2010 at 22:51 UTC | |
by mojotoad (Monsignor) on Oct 13, 2010 at 06:09 UTC |