Allow a bare MySQL date (no time) to be used in WebGUI::DateTime's constructor.
This commit is contained in:
parent
ca7a285ace
commit
48b4d91231
2 changed files with 19 additions and 7 deletions
|
|
@ -599,14 +599,18 @@ sub _splitMysql
|
|||
(\d+) # Month
|
||||
\D*
|
||||
(\d+) # Day
|
||||
\D*
|
||||
(\d+) # Hours
|
||||
\D*
|
||||
(\d+) # Minutes
|
||||
\D*
|
||||
(\d+) # Seconds
|
||||
(?: \D*
|
||||
(\d+) # Hours
|
||||
\D*
|
||||
(\d+) # Minutes
|
||||
\D*
|
||||
(\d+) # Seconds
|
||||
)?
|
||||
}x;
|
||||
|
||||
foreach my $unit (qw/hour minute second/) {
|
||||
$hash{$unit} = 0 if ($hash{$unit} eq '');
|
||||
}
|
||||
return %hash;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue