All Low add-ons are now owned by EEHarbor. Read the blog post.

Support archive

all_day Conditional not working

Nick 19 Aug 2016 12:33 problem, complete

In my template I have:
{if event_date_time:all_day != 'y'}{event_date_time:start_time format="%H:%i"} - {event_date_time:end_time format="%H:%i"}

But I get the dash whether or not it's an all day event. Have I missed something?

EE 2.9.2
LE 1.5.1

Replies

  1. Low 19 Aug 2016 14:09

    Are you closing the conditional?

  2. Nick 19 Aug 2016 14:16

    I am:

    {if event_date_time:all_day != 'y'}{event_date_time:start_time format="%H:%i"} - {event_date_time:end_time format="%H:%i"}{/if}

  3. Low 19 Aug 2016 14:19

    There *might* be a bug in EE's template parser in that version of EE, if I recall correctly.

    Try this as your opening conditional.

    {if '{event_date_time:all_day}' != 'y'}

  4. Nick 19 Aug 2016 14:23

    Ah, of course! Thank's Low - much appreciated!

  5. Low 19 Aug 2016 14:25

    Note that that syntax is *not* the recommended way. It's only because of a bug in EE that you need to use it like that. When you upgrade EE, you should revert the conditional to the previous syntax.

  6. Nick 19 Aug 2016 16:27

    Noted, thank you.