using [if] to compare dates
-
This is an awesome plugin; I use it exclusively for all my shortcode needs and it works great. So thank you very much for offering and supporting it. But I just ran into one that I can’t figure out. Not sure if you can help me, or if this is outside the scope of your support…
I am using The Events Calendar plugin which has an EventStartDate and EventEndDate. For events that are all-day, the EventStartDate is the beginning of the day (2015-06-22 00:00:00) and the EventEndDate is the end of the day (2015-06-26 23:59:59). Some of my events are one-day events that are all-day, some are multi-day.
I can do this:
[loop type=”tribe_events” field=”_EventEndDate” value=”future” date_format=”Y-m-d” count=”4″ orderby=”meta_value” key=”_EventStartDate” order=”ASC”]
[field _EventStartDate date_format=”F j”]: [field title-link][/loop]to get this:
June 22: this is a single-day event
June 25: this is a multi-day eventBut I would like to also show the EventEndDate for multi-day events only:
June 22: this is a single-day event
June 25-26: this is a multi-day eventI tried doing [if field=”EventEndDate” after=”EventStartDate”] but because of the stored time component, this is always true, even for single-day events. I tried using date_format but it doesn’t look like it’s supported in this context. I even tried doing it in two steps with [pass] but that wasn’t doing it either.
Any thoughts?
- The topic ‘using [if] to compare dates’ is closed to new replies.