diff(new DateTimeImmutable($dateTimeStr . ' Europe/Sofia')); } function is_before_interval(DateInterval $interval) { return $interval->invert === 0; } function is_after_interval(DateInterval $interval) { return $interval->invert === 1; } $eventStartInterval = interval_to_now($eventsConfig[$blog_slug]['startTime']); $isBeforeEvent = is_before_interval($eventStartInterval); $eventEndInterval = interval_to_now($eventsConfig[$blog_slug]['endTime']); $isAfterEvent = is_after_interval($eventEndInterval); $activeStreams = array_filter($eventsConfig[$blog_slug]['streams'], function($stream) { $streamStartInterval = interval_to_now($stream['startTime']); $streamEndInterval = interval_to_now($stream['endTime']); return is_after_interval($streamStartInterval) && is_before_interval($streamEndInterval); }); $activeStream = reset($activeStreams); $noCurrentStreams = !$isBeforeEvent && !$isAfterEvent && $activeStream === false; if ($isBeforeEvent) { ?>
format('%a'); ?> format('%H'); ?> format('%I'); ?>