diff --git a/index.php b/index.php index 0ccaeb8..834bbb5 100644 --- a/index.php +++ b/index.php @@ -1,6 +1,7 @@ (object) array( 'state_string' => 'Das Dorf ist gerade geschlossen.', @@ -80,9 +81,7 @@ $v = file_get_contents('/media/sg/dorf.jetzt_visitors');
= $state_map[$state]->state_string ?>
= $ical->iCalDateToDateTime($event->dtstart_array[3])->format('Y-m-d H:i') ?> | +iCalDateToDateTime($event->dtstart_array[3]); + $startdate_str = $startdate_loop->format($DATE_FORMAT); + $interval_loop = new DateInterval($event->duration); + if ($interval_loop->d != 0 || $interval_loop->h >= 24){ + $enddate_str = $startdate_loop->add($interval_loop)->format($DATE_FORMAT); + }else{ + $enddate_str = $startdate_loop->add($interval_loop)->format('H:i'); + } + echo($startdate_str . ' — ' . $enddate_str); ?> | = htmlspecialchars($event->summary) ?> |
---|