From 2a287e6def5ab54037222c963ab0875faf62fc1a Mon Sep 17 00:00:00 2001 From: zotlabs Date: Tue, 14 Jan 2020 13:29:45 -0800 Subject: event compatibility work --- include/event.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'include/event.php') diff --git a/include/event.php b/include/event.php index 30dca2df2..59057e7d5 100644 --- a/include/event.php +++ b/include/event.php @@ -250,7 +250,7 @@ function format_ical_sourcetext($s) { } -function format_event_bbcode($ev) { +function format_event_bbcode($ev, $utc = false) { $o = ''; @@ -258,6 +258,14 @@ function format_event_bbcode($ev) { $o .= '[event]' . $ev['event_vdata'] . '[/event]'; } + if ($utc && $ev['event-timezone'] !== 'UTC') { + $ev['dtstart'] = datetime_convert($ev['timezone'],'UTC',$ev['dtstart'],ATOM_TIME); + if ($ev['dtend'] && ! $ev['nofinish']) { + $ev['dtend'] = datetime_convert($ev['timezone'],'UTC',$ev['dtend'],ATOM_TIME); + } + $ev['timezone'] = 'UTC'; + } + if($ev['summary']) $o .= '[event-summary]' . $ev['summary'] . '[/event-summary]'; -- cgit v1.2.3