]> source.dussan.org Git - nextcloud-server.git/commitdiff
make edit event form work with DateTime Property UTC
authorGeorg Ehrke <dev@georgswebsite.de>
Thu, 21 Jun 2012 09:35:20 +0000 (11:35 +0200)
committerGeorg Ehrke <dev@georgswebsite.de>
Thu, 21 Jun 2012 09:35:20 +0000 (11:35 +0200)
apps/calendar/ajax/event/edit.form.php

index 6e5709a18dbc745c60768136eebdf796a0a4e9bc..26a0cc2a60a7008586a868c2ff5ea65a81ac870a 100644 (file)
@@ -27,6 +27,14 @@ $vevent = $object->VEVENT;
 $dtstart = $vevent->DTSTART;
 $dtend = OC_Calendar_Object::getDTEndFromVEvent($vevent);
 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::LOCAL:
                $startdate = $dtstart->getDateTime()->format('d-m-Y');