From: myk%mozilla.org <> Date: Wed, 27 Aug 2003 06:56:45 +0000 (+0000) Subject: Fix for bug 217029: creates appropriate date string if string is empty now that Date... X-Git-Tag: bugzilla-2.17.5~80 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9ba963d10b32db31a0ca159c729d4ebe99746950;p=thirdparty%2Fbugzilla.git Fix for bug 217029: creates appropriate date string if string is empty now that Date::Parse 2.27 doesn't do it for us auto-magically. r=justdave a=justdave --- diff --git a/Bugzilla/Search.pm b/Bugzilla/Search.pm index eed5013f5b..75cf8bb277 100644 --- a/Bugzilla/Search.pm +++ b/Bugzilla/Search.pm @@ -974,6 +974,10 @@ sub init { sub SqlifyDate { my ($str) = @_; $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 ($str =~ /^-?(\d+)([dDwWmMyY])$/) { # relative date my ($amount, $unit, $date) = ($1, lc $2, time); my ($sec, $min, $hour, $mday, $month, $year, $wday) = localtime($date);