0

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 1

0

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/

1
  • 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.
    – Todd
    Dec 11, 2015 at 3:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.