From 84183d9f7ef669779841cfccd65aae8000012e6d Mon Sep 17 00:00:00 2001 From: Mario Date: Sun, 5 Apr 2020 09:11:12 +0000 Subject: show event timezone only if adjust ist set and the offset of the event timezone is different from the channel default timezone offset --- Zotlabs/Module/Channel_calendar.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Channel_calendar.php b/Zotlabs/Module/Channel_calendar.php index f83a0167d..5d5fe300a 100644 --- a/Zotlabs/Module/Channel_calendar.php +++ b/Zotlabs/Module/Channel_calendar.php @@ -27,9 +27,6 @@ class Channel_calendar extends \Zotlabs\Web\Controller { if(($xchan) && ($xchan !== get_observer_hash())) return; - $timezone = ((x($_POST,'timezone_select')) ? escape_tags(trim($_POST['timezone_select'])) : ''); - $tz = (($timezone) ? $timezone : date_default_timezone_get()); - $categories = escape_tags(trim($_POST['categories'])); // allday events have adjust = 0, normal events have adjust = 1 @@ -38,6 +35,12 @@ class Channel_calendar extends \Zotlabs\Web\Controller { $start = datetime_convert((($adjust) ? $tz : 'UTC'), 'UTC', escape_tags($_REQUEST['dtstart'])); $finish = datetime_convert((($adjust) ? $tz : 'UTC'), 'UTC', escape_tags($_REQUEST['dtend'])); + $timezone = ((x($_POST,'timezone_select')) ? escape_tags(trim($_POST['timezone_select'])) : ''); + $tz = (($timezone) ? $timezone : date_default_timezone_get()); + + if(! $adjust) + $tz = 'UTC'; + $summary = escape_tags(trim($_POST['summary'])); $desc = escape_tags(trim($_POST['desc'])); $location = escape_tags(trim($_POST['location'])); -- cgit v1.2.3