Calendar: Use the default timezone that is set in lib/base.php
This commit is contained in:
parent
2d391298fb
commit
e5fdc6013a
|
@ -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']);
|
||||
|
|
|
@ -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));
|
||||
|
||||
|
|
|
@ -528,7 +528,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);
|
||||
|
|
Loading…
Reference in New Issue