aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2020-04-03 19:22:31 +0000
committerMario <mario@mariovavti.com>2020-04-03 19:22:31 +0000
commit625438ff642381472b4ba6c86bad7f26f69e8083 (patch)
tree968bf5ffd6f701f8f90f3306c36e223ec0d8a5a2
parent6cfaa5cba32eb1e7f2b4a0ba6bb281ebd610a54b (diff)
downloadvolse-hubzilla-625438ff642381472b4ba6c86bad7f26f69e8083.tar.gz
volse-hubzilla-625438ff642381472b4ba6c86bad7f26f69e8083.tar.bz2
volse-hubzilla-625438ff642381472b4ba6c86bad7f26f69e8083.zip
use timezone info for timezone display only- the actual time is in utc already.
-rw-r--r--Zotlabs/Module/Channel_calendar.php14
1 files changed, 5 insertions, 9 deletions
diff --git a/Zotlabs/Module/Channel_calendar.php b/Zotlabs/Module/Channel_calendar.php
index 7d75a7e41..79eb5797f 100644
--- a/Zotlabs/Module/Channel_calendar.php
+++ b/Zotlabs/Module/Channel_calendar.php
@@ -337,21 +337,15 @@ class Channel_calendar extends \Zotlabs\Web\Controller {
}
$events = [];
-
if($r) {
foreach($r as $rr) {
- $tz = get_iconfig($rr, 'event', 'timezone');
-
- if(! $tz)
- $tz = 'UTC';
-
- $start = (($rr['adjust']) ? datetime_convert($tz, date_default_timezone_get(), $rr['dtstart'], 'c') : datetime_convert('UTC', 'UTC', $rr['dtstart'], 'c'));
+ $start = (($rr['adjust']) ? datetime_convert('UTC', date_default_timezone_get(), $rr['dtstart'], 'c') : datetime_convert('UTC', 'UTC', $rr['dtstart'], 'c'));
if ($rr['nofinish']){
$end = null;
} else {
- $end = (($rr['adjust']) ? datetime_convert($tz, date_default_timezone_get(), $rr['dtend'], 'c') : datetime_convert('UTC', 'UTC', $rr['dtend'], 'c'));
+ $end = (($rr['adjust']) ? datetime_convert('UTC', date_default_timezone_get(), $rr['dtend'], 'c') : datetime_convert('UTC', 'UTC', $rr['dtend'], 'c'));
}
$catsenabled = feature_enabled(local_channel(),'categories');
@@ -371,12 +365,14 @@ class Channel_calendar extends \Zotlabs\Web\Controller {
$drop = array(z_root().'/events/drop/'.$rr['event_hash'],t('Delete event'),'','');
+ $tz = get_iconfig($rr, 'event', 'timezone');
+
$events[] = array(
'calendar_id' => 'channel_calendar',
'rw' => true,
'id'=>$rr['id'],
'uri' => $rr['event_hash'],
- 'timezone' => $tz,
+ 'timezone' => (($tz) ? $tz : 'UTC'),
'start'=> $start,
'end' => $end,
'drop' => $drop,