]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Fix for bug 217029: creates appropriate date string if string is empty now that Date...
authormyk%mozilla.org <>
Wed, 27 Aug 2003 06:56:45 +0000 (06:56 +0000)
committermyk%mozilla.org <>
Wed, 27 Aug 2003 06:56:45 +0000 (06:56 +0000)
r=justdave
a=justdave

Bugzilla/Search.pm

index eed5013f5b05f28c21d7a69f440db641840a65ab..75cf8bb277ce18fc9f846a98f317f8ef3f34421c 100644 (file)
@@ -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);