mirror of
https://github.com/espocrm/espocrm.git
synced 2026-06-29 15:36:07 +00:00
meeting all day fix date time zone
This commit is contained in:
@@ -251,15 +251,17 @@ class Event extends \Espo\Core\ORM\Repositories\RDB
|
||||
|
||||
protected function convertDateTimeToDefaultTimezone($string)
|
||||
{
|
||||
$dateTime = \DateTime::createFromFormat($this->getDateTime()->getInternalDateTimeFormat(), $string);
|
||||
$timeZone = $this->getConfig()->get('timeZone');
|
||||
if (empty($timeZone)) {
|
||||
$timeZone = 'UTC';
|
||||
}
|
||||
$tz = $timezone = new \DateTimeZone($timeZone);
|
||||
$timeZone = $this->getConfig()->get('timeZone') ?? 'UTC';
|
||||
|
||||
if ($dateTime) {
|
||||
return $dateTime->setTimezone($tz)->format($this->getDateTime()->getInternalDateTimeFormat());
|
||||
$tz = new \DateTimeZone($timeZone);
|
||||
|
||||
try {
|
||||
$dt = \DateTime::createFromFormat($this->getDateTime()->getInternalDateTimeFormat(), $string, $tz);
|
||||
} catch (\Exception $e) {}
|
||||
|
||||
if ($dt) {
|
||||
$utcTz = new \DateTimeZone('UTC');
|
||||
return $dt->setTimezone($utcTz)->format($this->getDateTime()->getInternalDateTimeFormat());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user