aboutsummaryrefslogtreecommitdiffstats
path: root/Bugzilla
diff options
context:
space:
mode:
authorFrédéric Buclin <LpSolit@gmail.com>2015-02-17 21:28:03 +0100
committerFrédéric Buclin <LpSolit@gmail.com>2015-02-17 21:28:03 +0100
commitb4c5ed1af358ce52e9c1413ead836e4a371094d0 (patch)
treec4274175f3ebcd25affbe8ba069eb6b0f9106404 /Bugzilla
parent4dc920c1272fc7469c5011335e4bb6b34b6bdf02 (diff)
downloadbugs-b4c5ed1af358ce52e9c1413ead836e4a371094d0.tar
bugs-b4c5ed1af358ce52e9c1413ead836e4a371094d0.tar.gz
bugs-b4c5ed1af358ce52e9c1413ead836e4a371094d0.tar.bz2
bugs-b4c5ed1af358ce52e9c1413ead836e4a371094d0.tar.xz
bugs-b4c5ed1af358ce52e9c1413ead836e4a371094d0.zip
Bug 1112181: Relative dates in the future involving months are incorrectly converted
r=dylan a=glob
Diffstat (limited to 'Bugzilla')
-rw-r--r--Bugzilla/Search.pm5
1 files changed, 3 insertions, 2 deletions
diff --git a/Bugzilla/Search.pm b/Bugzilla/Search.pm
index 0395d08ee..4c24dc6fd 100644
--- a/Bugzilla/Search.pm
+++ b/Bugzilla/Search.pm
@@ -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);
@@ -2241,7 +2241,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);
}