diff --git a/3rdparty/Sabre/VObject/Reader.php b/3rdparty/Sabre/VObject/Reader.php index 5ed7882ac9..7d1c282838 100644 --- a/3rdparty/Sabre/VObject/Reader.php +++ b/3rdparty/Sabre/VObject/Reader.php @@ -117,7 +117,7 @@ class Sabre_VObject_Reader { //$result = preg_match('/(?P[A-Z0-9-]+)(?:;(?P^(?([^:^\"]|\"([^\"]*)\")*))?"; $regex = "/^(?P$token)$parameters:(?P.*)$/i"; diff --git a/apps/calendar/ajax/events.php b/apps/calendar/ajax/events.php index 9a2ba88060..1ef6bd3059 100644 --- a/apps/calendar/ajax/events.php +++ b/apps/calendar/ajax/events.php @@ -30,7 +30,7 @@ $start = DateTime::createFromFormat('U', $_GET['start']); $end = DateTime::createFromFormat('U', $_GET['end']); $events = OC_Calendar_Object::allInPeriod($_GET['calendar_id'], $start, $end); -$user_timezone = OC_Preferences::getValue(OC_USER::getUser(), "calendar", "timezone", "Europe/London"); +$user_timezone = OC_Preferences::getValue(OC_USER::getUser(), 'calendar', 'timezone', date_default_timezone_get()); $return = array(); foreach($events as $event){ $object = OC_Calendar_Object::parse($event['calendardata']); diff --git a/apps/calendar/ajax/neweventform.php b/apps/calendar/ajax/neweventform.php index 588d364871..68423adb34 100644 --- a/apps/calendar/ajax/neweventform.php +++ b/apps/calendar/ajax/neweventform.php @@ -29,7 +29,7 @@ if (!$end){ } $start = new DateTime('@'.$start); $end = new DateTime('@'.$end); -$timezone = OC_Preferences::getValue(OC_USER::getUser(), 'calendar', 'timezone', 'Europe/London'); +$timezone = OC_Preferences::getValue(OC_USER::getUser(), 'calendar', 'timezone', date_default_timezone_get()); $start->setTimezone(new DateTimeZone($timezone)); $end->setTimezone(new DateTimeZone($timezone)); diff --git a/apps/calendar/lib/object.php b/apps/calendar/lib/object.php index 58d46ce6a7..b016469042 100644 --- a/apps/calendar/lib/object.php +++ b/apps/calendar/lib/object.php @@ -43,10 +43,12 @@ class OC_Calendar_Object{ public static function allInPeriod($id, $start, $end){ $stmt = OC_DB::prepare( 'SELECT * FROM *PREFIX*calendar_objects WHERE calendarid = ?' .' AND ((startdate >= ? AND startdate <= ? AND repeating = 0)' + .' OR (enddate >= ? AND enddate <= ? AND repeating = 0)' .' OR (startdate <= ? AND repeating = 1))' ); $start = self::getUTCforMDB($start); $end = self::getUTCforMDB($end); $result = $stmt->execute(array($id, + $start, $end, $start, $end, $end)); @@ -528,7 +530,7 @@ class OC_Calendar_Object{ $dtstart->setDateTime($start, Sabre_VObject_Element_DateTime::DATE); $dtend->setDateTime($end, Sabre_VObject_Element_DateTime::DATE); }else{ - $timezone = OC_Preferences::getValue(OC_USER::getUser(), "calendar", "timezone", "Europe/London"); + $timezone = OC_Preferences::getValue(OC_USER::getUser(), 'calendar', 'timezone', date_default_timezone_get()); $timezone = new DateTimeZone($timezone); $start = new DateTime($from.' '.$fromtime, $timezone); $end = new DateTime($to.' '.$totime, $timezone);