Skip Navigation

[Closed] We are currently facing a problem with a date field.

This support ticket is created 3 years, 10 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
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 1 reply, has 2 voices.

Last updated by Shane 3 years, 10 months ago.

Assisted by: Shane.

Author
Posts
#2338785
Error en Fecha Oferta.jpg

We use a conditional rule in our view to show this date field plus a few plain text words, when the field has been filled on the item, and we show a different plain text words when the field has not been filled.

This is the code we are using in our view to do this:

[wpv-conditional if="( $(valida-hasta) gt '0' )"]
<span>Válida hasta</span>: [types field='valida-hasta' style='text' format='j, F g:i a'][/types]
[/wpv-conditional]

It works almost correctly: if the date field has been filled, the red code is shown on the view, and if it has not been filled, nothing is showing up.

However, the problem comes when you fill the date field and then delete it (setting it to blank). In those cases, the date value is not shown, but the span text is. To fix this, we have to remove the item and then add it again making sure the date field is never filled.

Is there any way we can show that span text only when there is a date filled at the moment?

Thanks in advance.

Sijusa Subministraments

#2338955

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hello,

Thank you for getting in touch.

It would appear that there is still a value in the field even though you're checking it. There is a value greater than 0.

Can you add debug='true' to the conditional shortcode and let me know what is the debug output.

Thanks,
Shane

The topic ‘[Closed] We are currently facing a problem with a date field.’ is closed to new replies.