Bug 1112181: Relative dates in the future involving months are incorrectly converted
r=dylan a=glob git-svn-id: svn://10.0.0.236/trunk@265811 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
9f87a8d813
commit
d4df00dc66
@ -1 +1 @@
|
||||
9295
|
||||
9296
|
||||
@ -1 +1 @@
|
||||
077949ad0423d2446f2dff331fb5c44ee87c449a
|
||||
9f76caa9e3493c2df055bed736463659770c0798
|
||||
@ -34,7 +34,7 @@ use Date::Format;
|
||||
use Date::Parse;
|
||||
use Scalar::Util qw(blessed);
|
||||
use List::MoreUtils qw(all firstidx part uniq);
|
||||
use POSIX qw(INT_MAX);
|
||||
use POSIX qw(INT_MAX floor);
|
||||
use Storable qw(dclone);
|
||||
use Time::HiRes qw(gettimeofday tv_interval);
|
||||
|
||||
@ -2245,7 +2245,8 @@ sub SqlifyDate {
|
||||
}
|
||||
elsif ($unit eq 'm') {
|
||||
$month -= $amount;
|
||||
while ($month<0) { $year--; $month += 12; }
|
||||
$year += floor($month/12);
|
||||
$month %= 12;
|
||||
if ($startof) {
|
||||
return sprintf("%4d-%02d-01 00:00:00", $year+1900, $month+1);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user