Commit 7d8dfe52 by Qiang Xue

Fixed test break.

parent 074fd809
......@@ -352,7 +352,11 @@ class Formatter extends Component
if (is_numeric($value) || $value === '') {
$value = (double)$value;
} else {
$date = new DateTime($value);
try {
$date = new DateTime($value);
} catch (\Exception $e) {
return false;
}
$value = $date->format('U');
}
return $value;
......@@ -506,7 +510,7 @@ class Formatter extends Component
// to create a DateInterval with it
try {
$interval = new \DateInterval($value);
} catch (Exception $e) {
} catch (\Exception $e) {
// invalid date/time and invalid interval
return $this->nullDisplay;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment