Saltar navegación

[Resuelto] Compare date field to NOW in Conditional Output

This support ticket is created hace 5 años, 4 meses. 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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

Etiquetado: ,

Este tema contiene 1 respuesta, tiene 2 mensajes.

Última actualización por Luo Yang hace 5 años, 4 meses.

Asistido por: Luo Yang.

Autor
Mensajes
#1321753

Hi I have a toolset date field.

I would like to vary the display of what that field shows based on the current time.

Basically like so:

[wpv-conditional if="( $(wpcf-cancel-date) lt 'NOW' )"]

Where "NOW" would be the current date and time. Is there some way to achieve that without me writing my custom shortcode?

#1321783

Hello,

It is possible within [wpv-conditional] shortcode, for example:

[wpv-conditional if="( $(wpcf-cancel-date) lt 'NOW()' )"]
...

see our document:
https://toolset.com/documentation/user-guides/conditional-html-output-in-views/checking-types-fields-and-custom-fields/#checking-if-a-date-is-today

section "Checking if a date is today"