Skip Menu |

This queue is for tickets about the Date-Manip CPAN distribution.

Report information
The Basics
Id: 76336
Status: resolved
Priority: 0/
Queue: Date-Manip

People
Owner: Nobody in particular
Requestors: FBRIERE [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: (no value)



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";
Sorry about that. It was a bug, and it's fixed now. It'll be in the next release (6.32) which is due out June 1. Email me if you need a copy of the current development version containing this patch.