Subject: | Business delta sometimes falls on non-business day |
The attached script adds a business delta of +7 hours to 2011-04-01
12:32:00 (a Friday), which should fall on the following Monday:
$ perl -MDate::Manip -le 'print $Date::Manip::VERSION'
6.22
$ perl date_manip.pl
2011-04-04 12:02:00
$ perl -MDate::Manip -le 'print $Date::Manip::VERSION'
6.31
$ perl date_manip.pl
2011-04-02 12:02:00
Something went wrong between these two versions. Interestingly, a delta
of +8 hours will work just fine.
Subject: | date_manip.pl |
use Date::Manip;
my $base = new Date::Manip::Base;
$base->config(
WorkDayBeg => "09:00:00",
WorkDayEnd => "16:30:00",
);
my $date = new Date::Manip::Date $base;
$date->parse("2011-04-01 12:32:00");
my $delta = new Date::Manip::Delta $base;
$delta->set(business => [0,0,0,0,7,0,0]);
print $date->calc($delta)->printf('%Y-%m-%d %T'), "\n";