I'm working on a template for displaying the events for a particular day. Is there a way to control the start hour and end hour? This is an office that starts their day no earlier than 7am and ends their day no later than 7pm. So to have it showing "No events for this hour" at 1am seems silly.
1 Answer
I suggest having a look at the Calendar documentation for date/time formatting: https://solspace.com/docs/calendar/date_formatting/
You should be able to use date and time expressions such as (example):
date_range_start="yesterday @ noon" date_range_end="today @ 5:00 pm"
or in your case:
date_range_start="today @ 7:00 am" date_range_end="today @ 7:00 pm"
...to filter events based on date and time.
Important note: use this with the {exp:calendar:cal}
tag (not {exp:calendar:events}
or {exp:calendar:occurrences}
). It's the only tag that will follow date/time ranges based on the chronological flow of events.
Additional useful info about these tags can be found here: https://solspace.com/docs/calendar/getting_started/
-
Thank you. I had tried using date_range_start="today @ 0700" and "today @ 7:00 am", but neither of them were working (using the {exp:calendar:cal} tag). I ended up using an {if} statement to compare the time, and that works.– ToddDec 11, 2015 at 3:29