I’m relatively new to EE and I’m working on an EE site where I have a calendar of events, some of which span 3 or 4 days. For example, an event runs July 13-16. I’m able to compare the start date of the event and end date of the event (both of which are stored as EE variables for each entry), and by comparison, I can decide if I need to print just “July 13” or “July 13-16”.
However, the issue I am having is when an event spans over two months. For instance “May 31 - June 2”. By using the same method, I end up with “May 31 - 2”. I’ve searched high and low trying to figure out a way to compare the months of two dates, but have not been successful.
{startDate format="%F %j"} {if endDate != startDate} {if {startDate format="%n"} != {endDate format="%n"}} <!–This is the comparison that breaks –> - {endDate format="%F %j"} {if:else} - {endDate format="%j"} {/if} {/if}
Thanks in advance for any suggestions or input!!!
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.