format("d") ?> format("l") ?> format("D") ?> | |
---|---|
:00 | format('Y-m-d') . ' ' . date('H:i:s', $time + $i)); // Set id for this time span, for referencing in JS. $props = 'id="show-' . $merge->getTimestamp() . '"'; // We'll now use $merge to see if any shows are airing at this time $matchedshow = null; foreach ($schedule as $show) { if (check_in_range($show['start'], $show['end'], $merge->format('Y-m-d H:i:s'))) { $matchedshow = $show; break; } } $active = false; if (!$wrotepointer) { // If current time is in this range, draw pointer. $end = DateTimeImmutable::createFromMutable($merge)->add($halfhour); if ($now >= $merge && $now < $end) { $active = true; $props .= ' class="active"'; } } echo "";
if ($matchedshow) {
echo ' ' . $matchedshow['title'] . ' ';
// if no match was found, leave an empty node
}
if ($active) {
// Cell height here should be synced with height of '.calendar tbody tr td' in ../css/calendar.css
$height = 32;
$top = round(date_diff($merge, $now)->format('%i') / 30 * ($height-1));
echo '';
$wrotepointer = true;
}
echo " | \n";
}
?>