0

I am using Low Nice Date to work out the range between the start date and end date of a Low Event.

I am testing to see if if the start date and end date are the same, if they are the same I want the date format output in a certain way or differently if it is not the same date.

I am not using the 'All Day' option in Low events because these are not all day events.

The issue I have is it works fine for upcoming events, where the date are in the future, but it doesn't work with past events where the date are in the past.

Here is the code I am using:

{exp:low_nice_date:range from="{event_date:start_date}" to="{event_date:end_date}"}
    {if days == 0}
        {event_date:start_date format="%j %F %Y - %H:%i"}
    {if:else}
        {event_date:start_date format="%j %F"} - {event_date:end_date format="%j %F %Y"}
    {/if}
{/exp:low_nice_date:range}

A past example event dates: 22 June 2012 - 21 July 2012

For some reason this returns true for days == 0, although this is not true.

Any help on how I can get this working for past entries would be great.

1 Answer 1

1

Instead of using Low Nice Date, why not try the :one_day modifier that is available in Low Events itself? That should let you achieve what you want without an extra add-on:

{if event_date:one_day == 'y'}
    {event_date:start_date format="%j %F %Y - %H:%i"}
{if:else}
    {event_date:start_date format="%j %F"} - {event_date:end_date format="%j %F %Y"}
{/if}
0

Your Answer

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

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