Fix bug where DateTime($date, null) throws an exception (#3965)

This commit is contained in:
Aleksander Machniak 2014-11-22 12:10:06 -05:00
parent ac4f6e7562
commit fb4f815e53

View file

@ -223,7 +223,7 @@ abstract class kolab_format
if ($tz) $datetime->setTimezone($tz);
}
else if (is_string($datetime) && strlen($datetime)) {
$datetime = new DateTime($datetime, $tz ?: null);
$datetime = $tz ? new DateTime($datetime, $tz) : new DateTime($datetime);
}
}
catch (Exception $e) {}