• Resolved iantresman

    (@iantresman)


    I’m trying to display some text, depending on whether a datetime field is in the past.

    [pass field=wpcf-date in=timestamp]
      [if pass='{FIELD}' value=past-time]
        CONCERT ENDED
      [else]
        Coming soon. Stored={FIELD} Now=[today format=U]
      [/if]
    [/pass]

    The IF condition never seems to evaluate as true, and always displays “Coming soon”. I’ve tried numerous options, but am missing something obvious. Can anyone help.

    The wpcf-date field is from Toolset types, and works most other places I have used it. Typical output:
    Coming soon. Stored=1506535200 Now=1537383865

    Coming soon. Stored=1537988400 Now=1537384236

    • This topic was modified 7 years, 8 months ago by iantresman.
    • This topic was modified 7 years, 8 months ago by iantresman.
Viewing 1 replies (of 1 total)
  • Thread Starter iantresman

    (@iantresman)

    I think I’ve solved the problem, which I had over complicated. The solution is to remove the [pass] field:

    [if field=wpcf-date value=past-time in=timestamp]
    CONCERT ENDED
    [else]
    Coming soon.
    [/if]

Viewing 1 replies (of 1 total)

The topic ‘Comparing custom datetime field’ is closed to new replies.