Alright I went a little overboard here: Times of Day - Loops & Logic
So the core idea here is using <Loop time=24></Loop>
to arbitrarily loop 24 times (once for each hour of the day). To start at 0:00 instead of 1:00 I used some math to subtract 1 from the current loop count <Math><Get loop=count /> - 1</Math>
, and then a bit hackily fed the result into the format tag to turn it into a datetime value <Format date="Y-m-d H:i:s"><Field date date_format="Y-m-d" /> <Get index_to_hour />:00</Format>
. This value could in theory be used with date conditionals to find posts that belong in each slot, but I haven’t actually populated the slots with any events yet (it may become complicated to place events that should fill half slots or multiple slots).
I also implemented a current time marker by testing whether the slot matches the current day and hour, using some math to convert minutes to a percentage <Math><Date format="i">now</Date> / 60 * 100</Math>%
and using the value to style the top property of the marker div inline <div class="week-view__day__time-marker" style="top: {Get minute_to_percent}"></div>