event display/edit forms now properly show timezone-adjusted date/time
This commit is contained in:
parent
b232d96522
commit
8381f056be
2 changed files with 6 additions and 4 deletions
|
@ -94,14 +94,14 @@ $dtstart = $vevent->DTSTART;
|
|||
$dtend = OC_Calendar_Object::getDTEndFromVEvent($vevent);
|
||||
switch($dtstart->getDateType()) {
|
||||
case Sabre\VObject\Property\DateTime::UTC:
|
||||
$timezone = new DateTimeZone(OC_Calendar_App::getTimezone());
|
||||
case Sabre\VObject\Property\DateTime::LOCALTZ:
|
||||
$timezone = new DateTimeZone(OC_Calendar_App::$tz);
|
||||
$newDT = $dtstart->getDateTime();
|
||||
$newDT->setTimezone($timezone);
|
||||
$dtstart->setDateTime($newDT);
|
||||
$newDT = $dtend->getDateTime();
|
||||
$newDT->setTimezone($timezone);
|
||||
$dtend->setDateTime($newDT);
|
||||
case Sabre\VObject\Property\DateTime::LOCALTZ:
|
||||
case Sabre\VObject\Property\DateTime::LOCAL:
|
||||
$startdate = $dtstart->getDateTime()->format('d-m-Y');
|
||||
$starttime = $dtstart->getDateTime()->format('H:i');
|
||||
|
|
|
@ -32,16 +32,17 @@ $permissions = OC_Calendar_App::getPermissions($id, OC_Calendar_App::EVENT, $acc
|
|||
|
||||
$dtstart = $vevent->DTSTART;
|
||||
$dtend = OC_Calendar_Object::getDTEndFromVEvent($vevent);
|
||||
|
||||
switch($dtstart->getDateType()) {
|
||||
case Sabre\VObject\Property\DateTime::UTC:
|
||||
$timezone = new DateTimeZone(OC_Calendar_App::getTimezone());
|
||||
case Sabre\VObject\Property\DateTime::LOCALTZ:
|
||||
$timezone = new DateTimeZone(OC_Calendar_App::$tz);
|
||||
$newDT = $dtstart->getDateTime();
|
||||
$newDT->setTimezone($timezone);
|
||||
$dtstart->setDateTime($newDT);
|
||||
$newDT = $dtend->getDateTime();
|
||||
$newDT->setTimezone($timezone);
|
||||
$dtend->setDateTime($newDT);
|
||||
case Sabre\VObject\Property\DateTime::LOCALTZ:
|
||||
case Sabre\VObject\Property\DateTime::LOCAL:
|
||||
$startdate = $dtstart->getDateTime()->format('d-m-Y');
|
||||
$starttime = $dtstart->getDateTime()->format('H:i');
|
||||
|
@ -49,6 +50,7 @@ switch($dtstart->getDateType()) {
|
|||
$endtime = $dtend->getDateTime()->format('H:i');
|
||||
$allday = false;
|
||||
break;
|
||||
// all-day event
|
||||
case Sabre\VObject\Property\DateTime::DATE:
|
||||
$startdate = $dtstart->getDateTime()->format('d-m-Y');
|
||||
$starttime = '';
|
||||
|
|
Loading…
Reference in a new issue