Fix timezone
This commit is contained in:
parent
1b59608ff7
commit
abddcf6d47
1 changed files with 4 additions and 2 deletions
|
|
@ -33,14 +33,16 @@ $filter = filter_input(INPUT_GET, 'filter', FILTER_SANITIZE_SPECIAL_CHARS); // F
|
||||||
$events = $ical->sortEventsWithOrder($ical->eventsFromInterval($period_val . ' month'));
|
$events = $ical->sortEventsWithOrder($ical->eventsFromInterval($period_val . ' month'));
|
||||||
$result = [];
|
$result = [];
|
||||||
|
|
||||||
|
$timeZone = new DateTimeZone('Europe/Berlin');
|
||||||
|
|
||||||
foreach ($events as $event) {
|
foreach ($events as $event) {
|
||||||
$cat = $event->categories ?? '';
|
$cat = $event->categories ?? '';
|
||||||
|
|
||||||
if ($filter && stripos($cat, $filter) === false) continue;
|
if ($filter && stripos($cat, $filter) === false) continue;
|
||||||
if (stripos($cat, "hidden") !== false) continue;
|
if (stripos($cat, "hidden") !== false) continue;
|
||||||
|
|
||||||
$start = new DateTime($event->dtstart);
|
$start = new DateTime($event->dtstart, $timeZone);
|
||||||
$end = new DateTime($event->dtend);
|
$end = new DateTime($event->dtend, $timeZone);
|
||||||
$uid = $event->uid;
|
$uid = $event->uid;
|
||||||
|
|
||||||
$interval = new DateInterval('P1D');
|
$interval = new DateInterval('P1D');
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue