Subject: | Date::Manip::Delta_Format with "%yt" format uses only years field value (not weeks and others) |
Date::Manip::Delta_Format with "%yt" format uses only years field value
(not weeks and others).
Following code shows this bug:
use Date::Manip;
my $d1 = Date::Manip::ParseDate('2005-10-10');
my $d2 = Date::Manip::ParseDate('2008-10-10');
# +0:0:156:4:0:0:0
my $years = Date::Manip::Delta_Format(Date::Manip::DateCalc($d1, $d2),
undef, "%yt");
printf("year diff: %s (returned %.02f)\n", (int($years)==3 ? "ok" :
"ERROR", $years));
With Date::Manip v5.42 we got:
year diff: ok (returned 3.00)
But with Date::Manip v5.54 we got:
year diff: ERROR (returned 0.00)