aboutsummaryrefslogtreecommitdiffstats
path: root/include/event.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2021-04-22 17:42:58 +0000
committerMario <mario@mariovavti.com>2021-04-22 17:42:58 +0000
commitc19eb94c52f40777d0ffaf6b91a3fc2eaaf6910a (patch)
tree4a051abb43624dee8d505dd14f9e1da3c9518bfd /include/event.php
parenteb793b160103bddab071ca7e91daf500ec262315 (diff)
downloadvolse-hubzilla-c19eb94c52f40777d0ffaf6b91a3fc2eaaf6910a.tar.gz
volse-hubzilla-c19eb94c52f40777d0ffaf6b91a3fc2eaaf6910a.tar.bz2
volse-hubzilla-c19eb94c52f40777d0ffaf6b91a3fc2eaaf6910a.zip
make sure we transform events to UTC on import before storing. Transform from event timezone if available otherwise channel default
Diffstat (limited to 'include/event.php')
-rw-r--r--include/event.php10
1 files changed, 5 insertions, 5 deletions
diff --git a/include/event.php b/include/event.php
index 765086167..440f559da 100644
--- a/include/event.php
+++ b/include/event.php
@@ -862,15 +862,15 @@ function event_import_ical($ical, $uid) {
// we do not have it here since parse_ical_file() is passing the vevent only.
$timezone_obj = \Sabre\VObject\TimeZoneUtil::getTimeZone($ical->DTSTART['TZID']);
$timezone = $timezone_obj->getName();
- $ev['timezone'] = $timezone;
+ $ev['timezone'] = (($timezone) ? $timezone : date_default_timezone_get());
}
- $ev['dtstart'] = datetime_convert((($ev['adjust']) ? 'UTC' : date_default_timezone_get()),$ev['timezone'],
+ $ev['dtstart'] = datetime_convert((($ev['adjust']) ? 'UTC' : $ev['timezone']), 'UTC',
$dtstart->format(\DateTime::W3C));
if(isset($ical->DTEND)) {
$dtend = $ical->DTEND->getDateTime();
- $ev['dtend'] = datetime_convert((($ev['adjust']) ? 'UTC' : date_default_timezone_get()),$ev['timezone'],
+ $ev['dtend'] = datetime_convert((($ev['adjust']) ? 'UTC' : $ev['timezone']), 'UTC',
$dtend->format(\DateTime::W3C));
}
else {
@@ -1311,9 +1311,9 @@ function event_store_item($arr, $event) {
}
// propagate the event resource_id so that posts containing it are easily searchable in downstream copies
- // of the item which have not stored the actual event. Required for Diaspora event federation as Diaspora
+ // of the item which have not stored the actual event. Required for Diaspora event federation as Diaspora
// event_participation messages refer to the event resource_id as a parent, while out own event attendance
- // activities refer to the item message_id as the parent.
+ // activities refer to the item message_id as the parent.
set_iconfig($item_arr, 'system','event_id',$event['event_hash'],true);