summaryrefslogtreecommitdiffstats
path: root/Bugzilla
diff options
context:
space:
mode:
authorFrédéric Buclin <LpSolit@gmail.com>2015-02-17 21:26:38 +0100
committerFrédéric Buclin <LpSolit@gmail.com>2015-02-17 21:26:38 +0100
commit9f76caa9e3493c2df055bed736463659770c0798 (patch)
tree00353f5f055e082883624ea51846832f1df4899e /Bugzilla
parent077949ad0423d2446f2dff331fb5c44ee87c449a (diff)
downloadbugzilla-9f76caa9e3493c2df055bed736463659770c0798.tar.gz
bugzilla-9f76caa9e3493c2df055bed736463659770c0798.tar.xz
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 80de76311..d712d4bb6 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);
@@ -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);
}