I’m setting up a page displaying events with start and end dates. I have set up corresponding date fields for the channel with date field for start date and date field for end date. I followed the Date Variable Formatting guide from user guide to set up countdown messages depending if current date is before start date for event or if current date is past end date for event. The code looks like this and works fine with future and past parameters:
{event_starts:relative units="years|months|weeks|days" depth="2" future="<b>Starts in:</b><br> %s" past=""}
{event_ends:relative units="years|months|weeks|days" depth="2" future="" past="<b>Finished:</b><br> %s ago"}
But how do you show a message saying the event is currently running if today’s date is between start date and end date?
Only parameters for date variable formatting I could find are future and past where you can set how countdown will work, but what parameter or combination of these should be used to say if date is past start date and end date is in future, then display message saying “Event is currently running”? As there is no “present” parameter in date formatting which would check if date is between 2 dates and display a message if it is, how would you achieve this?
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.