diff options
author | Mario Vavti <mario@mariovavti.com> | 2019-05-22 12:40:37 +0200 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2019-05-22 12:40:37 +0200 |
commit | 39613aa2d9298e13629b5b4a7c6b6f1bbe7edca5 (patch) | |
tree | f992777423a1b04b757578f9cfbf90be349091de /Zotlabs/Module/Cdav.php | |
parent | e834c7fe3e421a7a52e27b274d8ea35bd2ad5bec (diff) | |
download | volse-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.php | 12 |
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[] = [ |