diff options
author | Thomas Tanghus <thomas@tanghus.net> | 2011-12-04 20:42:30 +0100 |
---|---|---|
committer | Thomas Tanghus <thomas@tanghus.net> | 2011-12-04 20:42:30 +0100 |
commit | 2b48b733a3052c07e199dc2196426a529e977d2d (patch) | |
tree | b918cb0354fd054640f61e8224ca70cd28f455fa /apps/calendar | |
parent | 95ae0f23f14c9e6854999233481e107cc330d70f (diff) | |
parent | 0bbeb13e260caf97cb1029c66482101e839e6f32 (diff) | |
download | nextcloud-server-2b48b733a3052c07e199dc2196426a529e977d2d.tar.gz nextcloud-server-2b48b733a3052c07e199dc2196426a529e977d2d.zip |
Merge gitorious.org:~tanghus/owncloud/tanghus-owncloud into tanghus_remote_backup
Diffstat (limited to 'apps/calendar')
-rw-r--r-- | apps/calendar/ajax/events.php | 2 | ||||
-rw-r--r-- | apps/calendar/ajax/neweventform.php | 2 | ||||
-rw-r--r-- | apps/calendar/lib/object.php | 4 |
3 files changed, 5 insertions, 3 deletions
diff --git a/apps/calendar/ajax/events.php b/apps/calendar/ajax/events.php index 9a2ba880608..1ef6bd30594 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 588d364871c..68423adb344 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 58d46ce6a7d..b0164690429 100644 --- a/apps/calendar/lib/object.php +++ b/apps/calendar/lib/object.php @@ -43,11 +43,13 @@ 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)); $calendarobjects = array(); @@ -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); |