Is there any way to have event times display as either a start and end time or, if there is no specific end time for the event, just the start time. Basically I would like to be able to write something like this: {if repeet:end_time == repeet:start_time} {entry_date format="%l, %g:%i %A"} {if:else} {entry_date format="%l, %g:%i %A"}{expiration_date format=" - %g:%i %A"} {/if}
Does that make sense?
Yep can be done but needs a little bit of work to get it going.
I just had to do this on a site here and this is how I did it :
{if "{entry_date format="%Y%z"}" == "{expiration_date format="%Y%z"}"}
{entry_date format="%j%S %F %Y"} at {entry_date format="%g:%i %A"}
{if:else}
{entry_date format="%j%S %F %Y"} to {expiration_date format="%j%S %F %Y"} from {entry_date format="%G:%i"} to {expiration_date format="%g:%i %A"}
{/if}
I’m not 100% sure that you are actually supposed to do what I have done there in that I have the variables quoted but I just couldn’t find another way of doing it quickly so this had to suffice as the site needed it working as soon as possible. You could probably also use PHP to compare the time-stamps though i guess.
Would be nice for one of the moderators to let us know how to get this working the right way though.
Hope that helps a bit?
Best wishes,
Mark
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.