0

EE2.9.2, Low Nice Date 2.2.1

Main template:

{exp:zoo_visitor:details}
{embed="applications/_author-application-list"
    memberDob="{cf_stual_date_of_birth timezone='Europe/London'}"
    courseStartDateUnix="{exp:low_variables:single var="lv_course_start_ba_mt" format='%U'}"
    minimumAge="{lv_course_min_age_ba_mt}"
    }
{/exp:zoo_visitor:details}

{cf_stual_date_of_birth} is a DropDate custom field - Value: 5th March 1998 {lv_course_start_ba_mt} is a Low variable Time Date field - Value: 30th September 2015 {lv_course_min_age_ba_mt} is a Low variable text field - Value: 21

I'm using an embed for other reasons. I've stripped lots of stuff out for this example.

Embedded Template: applications/_author_application_list

{exp:low_nice_date:range from="{embed:memberDob}" to="{embed:courseStartDateUnix}"}
    <p>{years} / {embed:minimumAge}</p>
    {if "{years}" >= "{embed:minimumAge}"}
        <p>YES</p>
    {if:else}
        <p>NO</p>
    {/if}
{/exp:low_nice_date:range}

This returns:

<p>17 / 21</p>
<p>YES</p>

So it seems like the embed variables are working as the to and from values in the Low Nice Date tag but not in the conditional. Should this work? Is this a parse order issue? Any idea for a workaround?

I have tried using the CC Time Difference add-on as well but I ran into some other issues with that. This is the closest I've got to a working solution.

1 Answer 1

0

It was a parse order issue and switching on Early Parsing in Low Variables for {lv_course_min_age_ba_mt} has fixed it.

Woot!

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.