aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module/Cdav.php
diff options
context:
space:
mode:
Diffstat (limited to 'Zotlabs/Module/Cdav.php')
-rw-r--r--Zotlabs/Module/Cdav.php12
1 files changed, 10 insertions, 2 deletions
diff --git a/Zotlabs/Module/Cdav.php b/Zotlabs/Module/Cdav.php
index 08d27c850..de639e281 100644
--- a/Zotlabs/Module/Cdav.php
+++ b/Zotlabs/Module/Cdav.php
@@ -1144,16 +1144,24 @@ class Cdav extends Controller {
$dtend = (string)$vevent->DTEND;
$description = (string)$vevent->DESCRIPTION;
$location = (string)$vevent->LOCATION;
- $timezone = (string)$vevent->DTSTART['TZID'];
+ $timezone_str = (string)$vevent->DTSTART['TZID'];
$rw = ((cdav_perms($id[0],$calendars,true)) ? true : false);
$editable = $rw ? true : false;
$recurrent = ((isset($vevent->{'RECURRENCE-ID'})) ? true : false);
if($recurrent) {
$editable = false;
- $timezone = $recurrent_timezone;
+ $timezone_str = $recurrent_timezone;
}
+ // Try to get an usable olson format timezone
+ $timezone_obj = \Sabre\VObject\TimeZoneUtil::getTimeZone($timezone_str, $vcalendar);
+ $timezone = $timezone_obj->getName();
+
+ // If we got nothing fallback to UTC
+ if(! $timezone)
+ $timezone = 'UTC';
+
$allDay = (((string)$vevent->DTSTART['VALUE'] == 'DATE') ? true : false);
$events[] = [