Skip Navigation

[Resolved] Conditional dates

This support ticket is created 5 years, 6 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 1 reply, has 2 voices.

Last updated by Christian Cox 5 years, 6 months ago.

Assisted by: Christian Cox.

Author
Posts
#1313423

Follow up to: https://toolset.com/forums/topic/conditional-dates/#post-1313421

How do I do it so that if the date from field wpcf-note-date has not arrived yet (it is a custom calendar field), don't show the message yet? Only show the message after that date has passed?

Like:
[wpv-conditional if="wpcf-note-date has passed"]Show this message that the date has passed[/wpv-conditional]

#1313877

Hi, you can use the TODAY() function to determine if the custom field date has passed:

[wpv-conditional if="( $(wpcf-note-date) lt 'TODAY()' )"]Note date is before today[/wpv-conditional]

If you want to display the message if the note date happens today, or has already passed, you can use the FUTURE_DAY() function:

[wpv-conditional if="( $(wpcf-note-date) lt 'FUTURE_DAY(1)' )"]Note date is today or before today[/wpv-conditional]