another timezone fix

This commit is contained in:
zotlabs 2019-10-04 14:28:31 -07:00
parent 58b77e3427
commit baffa969d3

View File

@ -202,6 +202,10 @@ class Activity {
$ev = bbtoevent($x['content']); $ev = bbtoevent($x['content']);
if($ev) { if($ev) {
if (! $ev['timezone']) {
$ev['timezone'] = 'UTC';
}
$actor = null; $actor = null;
if(array_key_exists('author',$x) && array_key_exists('link',$x['author'])) { if(array_key_exists('author',$x) && array_key_exists('link',$x['author'])) {
$actor = $x['author']['link'][0]['href']; $actor = $x['author']['link'][0]['href'];
@ -212,14 +216,14 @@ class Activity {
'name' => $ev['summary'], 'name' => $ev['summary'],
// 'summary' => bbcode($ev['summary'], [ 'cache' => true ]), // 'summary' => bbcode($ev['summary'], [ 'cache' => true ]),
// RFC3339 Section 4.3 // RFC3339 Section 4.3
'startTime' => (($ev['adjust']) ? datetime_convert('UTC','UTC',$ev['dtstart'], ATOM_TIME) : datetime_convert('UTC','UTC',$ev['dtstart'],'Y-m-d\\TH:i:s-00:00')), 'startTime' => (($ev['adjust']) ? datetime_convert($ev['timezone'],'UTC',$ev['dtstart'], ATOM_TIME) : datetime_convert('UTC','UTC',$ev['dtstart'],'Y-m-d\\TH:i:s-00:00')),
'content' => bbcode($ev['description'], [ 'cache' => true ]), 'content' => bbcode($ev['description'], [ 'cache' => true ]),
'location' => [ 'type' => 'Place', 'content' => bbcode($ev['location'], [ 'cache' => true ]) ], 'location' => [ 'type' => 'Place', 'content' => bbcode($ev['location'], [ 'cache' => true ]) ],
'source' => [ 'content' => format_event_bbcode($ev), 'mediaType' => 'text/bbcode' ], 'source' => [ 'content' => format_event_bbcode($ev), 'mediaType' => 'text/bbcode' ],
'actor' => $actor, 'actor' => $actor,
]; ];
if(! $ev['nofinish']) { if(! $ev['nofinish']) {
$y['endTime'] = (($ev['adjust']) ? datetime_convert('UTC','UTC',$ev['dtend'], ATOM_TIME) : datetime_convert('UTC','UTC',$ev['dtend'],'Y-m-d\\TH:i:s-00:00')); $y['endTime'] = (($ev['adjust']) ? datetime_convert($ev['timezone'],'UTC',$ev['dtend'], ATOM_TIME) : datetime_convert('UTC','UTC',$ev['dtend'],'Y-m-d\\TH:i:s-00:00'));
} }
// copy attachments from the passed object - these are already formatted for ActivityStreams // copy attachments from the passed object - these are already formatted for ActivityStreams