From b9dec84489fc90cb43ac9c219c77eb82f52d857b Mon Sep 17 00:00:00 2001 From: zotlabs Date: Thu, 3 Oct 2019 22:16:11 -0700 Subject: fix event timezones for zot6 --- Zotlabs/Lib/Activity.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php index b74f6b2bc..d1fa8e49e 100644 --- a/Zotlabs/Lib/Activity.php +++ b/Zotlabs/Lib/Activity.php @@ -202,6 +202,19 @@ class Activity { $ev = bbtoevent($x['content']); if($ev) { + $t = q("select id from item where resource_type = 'event' and resource_id = '%s'", + dbesc($ev['event_hash']) + ); + if($t) + $tz = get_iconfig($t[0]['id'],'event','timezone','UTC'); + if(! $tz) + $tz = 'UTC'; + + $ev['dtstart'] = datetime_convert($tz,'UTC',$ev['dtstart'], ATOM_TIME); + if (! $ev['nofinish']) { + $ev['dtend'] = datetime_convert($tz,'UTC',$ev['dtend'], ATOM_TIME); + } + $actor = null; if(array_key_exists('author',$x) && array_key_exists('link',$x['author'])) { $actor = $x['author']['link'][0]['href']; -- cgit v1.2.3