mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-12 17:08:34 +01:00
allow to pass JSON serialized date-array with date&timezone to constructor
This commit is contained in:
parent
40bd7719bb
commit
53c20ed5f7
@ -143,6 +143,12 @@ class DateTime extends \DateTime
|
||||
break;
|
||||
|
||||
case 'array':
|
||||
// JSON serialized DateTime object
|
||||
if (isset($time['timezone_type']) && !empty($time['date']) && !empty($time['timezone']))
|
||||
{
|
||||
parent::__construct($time['date'], new DateTimeZone($time['timezone']));
|
||||
break;
|
||||
}
|
||||
parent::__construct('now',$tz);
|
||||
if (isset($time['Y'])) // array format used in eTemplate
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user