mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-24 17:04:14 +01:00
allow to pass JSON serialized date-array with date&timezone to constructor
This commit is contained in:
parent
30dea4034a
commit
1e2c7de6f7
@ -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