aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module/Cdav.php
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2019-05-22 12:40:37 +0200
committerMario Vavti <mario@mariovavti.com>2019-05-22 12:40:37 +0200
commit39613aa2d9298e13629b5b4a7c6b6f1bbe7edca5 (patch)
treef992777423a1b04b757578f9cfbf90be349091de /Zotlabs/Module/Cdav.php
parente834c7fe3e421a7a52e27b274d8ea35bd2ad5bec (diff)
downloadvolse-hubzilla-39613aa2d9298e13629b5b4a7c6b6f1bbe7edca5.tar.gz
volse-hubzilla-39613aa2d9298e13629b5b4a7c6b6f1bbe7edca5.tar.bz2
volse-hubzilla-39613aa2d9298e13629b5b4a7c6b6f1bbe7edca5.zip
improve timezone detection for caldav and remove smart birthday feature. Force adjust birthdays until we agree on how to deal with this.
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[] = [