make edit event form work with DateTime Property UTC

remotes/origin/stable4
Georg Ehrke 13 years ago
parent 43674b1759
commit 37ed3b5bd2
  1. 8
      apps/calendar/ajax/event/edit.form.php

@ -27,6 +27,14 @@ $vevent = $object->VEVENT;
$dtstart = $vevent->DTSTART; $dtstart = $vevent->DTSTART;
$dtend = OC_Calendar_Object::getDTEndFromVEvent($vevent); $dtend = OC_Calendar_Object::getDTEndFromVEvent($vevent);
switch($dtstart->getDateType()) { switch($dtstart->getDateType()) {
case Sabre_VObject_Property_DateTime::UTC:
$timeOffset = OC_Calendar_App::$tz*60;
$newDT = $dtstart->getDateTime();
$newDT->add(new DateInterval("PT" . $timeOffset . "M"));
$dtstart->setDateTime($newDT);
$newDT = $dtend->getDateTime();
$newDT->add(new DateInterval("PT" . $timeOffset . "M"));
$dtend->setDateTime($newDT);
case Sabre_VObject_Property_DateTime::LOCALTZ: case Sabre_VObject_Property_DateTime::LOCALTZ:
case Sabre_VObject_Property_DateTime::LOCAL: case Sabre_VObject_Property_DateTime::LOCAL:
$startdate = $dtstart->getDateTime()->format('d-m-Y'); $startdate = $dtstart->getDateTime()->format('d-m-Y');

Loading…
Cancel
Save