Bug#667685: libdate-manip-perl: Business delta sometimes falls on non-business day

Frédéric Brière fbriere at fbriere.net
Thu Apr 5 21:07:45 UTC 2012


Package: libdate-manip-perl
Version: 6.31-1
Severity: normal
Forwarded: https://rt.cpan.org/Ticket/Display.html?id=76336

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.

-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)

Kernel: Linux 3.2.0-2-686-pae (SMP w/3 CPU cores)
Locale: LANG=en_CA.UTF-8, LC_CTYPE=en_CA.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages libdate-manip-perl depends on:
ii  libyaml-syck-perl  1.20-1
ii  perl               5.14.2-9

libdate-manip-perl recommends no packages.

libdate-manip-perl suggests no packages.

-- no debconf information
-------------- next part --------------
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";



More information about the pkg-perl-maintainers mailing list