Changeset View
Changeset View
Standalone View
Standalone View
plugins/libcalendaring/lib/Horde_Date.php
Show First 20 Lines • Show All 1090 Lines • ▼ Show 20 Line(s) | |||||
$this->_min = (int)$date['minute']; | $this->_min = (int)$date['minute']; | ||||
} | } | ||||
$this->_correct(); | $this->_correct(); | ||||
} | } | ||||
protected function _initializeFromObject($date) | protected function _initializeFromObject($date) | ||||
{ | { | ||||
if ($date instanceof DateTime) { | if ($date instanceof DateTime || $date instanceof DateTimeImmutable) { | ||||
$this->_year = (int)$date->format('Y'); | $this->_year = (int)$date->format('Y'); | ||||
$this->_month = (int)$date->format('m'); | $this->_month = (int)$date->format('m'); | ||||
$this->_mday = (int)$date->format('d'); | $this->_mday = (int)$date->format('d'); | ||||
$this->_hour = (int)$date->format('H'); | $this->_hour = (int)$date->format('H'); | ||||
$this->_min = (int)$date->format('i'); | $this->_min = (int)$date->format('i'); | ||||
$this->_sec = (int)$date->format('s'); | $this->_sec = (int)$date->format('s'); | ||||
$this->_initializeTimezone($date->getTimezone()->getName()); | $this->_initializeTimezone($date->getTimezone()->getName()); | ||||
} else { | } else { | ||||
▲ Show 20 Lines • Show All 197 Lines • Show Last 20 Lines |