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 git-svn-id: svn://10.0.0.236/trunk@146359 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
9e281a8999
commit
45baa4a1e1
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user