$fdt = $orig_event['finish'] ?? 'now';
$tz = date_default_timezone_get();
- if (!empty($orig_event)) {
+ if (isset($orig_event['adjust'])) {
$tz = ($orig_event['adjust'] ? date_default_timezone_get() : 'UTC');
}
}
$private = intval($arr['private'] ?? 0);
- $conditions = ['uid' => $event['uid']];
if ($event['cid']) {
- $conditions['id'] = $event['cid'];
+ $conditions = ['id' => $event['cid']];
} else {
- $conditions['self'] = true;
+ $conditions = ['uid' => $event['uid'], 'self' => true];
}
$contact = DBA::selectFirst('contact', [], $conditions);