summaryrefslogtreecommitdiffstats
path: root/Bugzilla
diff options
context:
space:
mode:
authorFedor Ezeev <fezeev@gmail.com>2014-12-11 19:06:22 +0100
committerGervase Markham <gerv@gerv.net>2014-12-11 19:06:22 +0100
commitf264250ff423e53d44fee297b5648f437c910d02 (patch)
tree8c511878318c04ec9e61d3b5fe0fe2b300ad433f /Bugzilla
parent8ab6357c5ad5aca8ecc0a622a3d0ceed7e3eb905 (diff)
downloadbugzilla-f264250ff423e53d44fee297b5648f437c910d02.tar.gz
bugzilla-f264250ff423e53d44fee297b5648f437c910d02.tar.xz
Bug 978635: now is interpreted as midnight for searches. r=gerv, a=simon.
Diffstat (limited to 'Bugzilla')
-rw-r--r--Bugzilla/Search.pm6
1 files changed, 5 insertions, 1 deletions
diff --git a/Bugzilla/Search.pm b/Bugzilla/Search.pm
index 0395d08ee..80de76311 100644
--- a/Bugzilla/Search.pm
+++ b/Bugzilla/Search.pm
@@ -2206,11 +2206,15 @@ sub _date_translate {
sub SqlifyDate {
my ($str) = @_;
my $fmt = "%Y-%m-%d %H:%M:%S";
- $str = "" if (!defined $str || lc($str) eq 'now');
+ $str = "" if (!defined $str);
if ($str eq "") {
my ($sec, $min, $hour, $mday, $month, $year, $wday) = localtime(time());
return sprintf("%4d-%02d-%02d 00:00:00", $year+1900, $month+1, $mday);
}
+ if (lc($str) eq 'now') {
+ my ($sec, $min, $hour, $mday, $month, $year, $wday) = localtime(time());
+ return sprintf("%4d-%02d-%02d %02d:%02d:%02d", $year+1900, $month+1, $mday, $hour, $min, $sec);
+ }
if ($str =~ /^(-|\+)?(\d+)([hdwmy])(s?)$/i) { # relative date
my ($sign, $amount, $unit, $startof, $date) = ($1, $2, lc $3, lc $4, time);