Skip Navigation

[Résolu] format filter date selectfield

This support ticket is created Il y a 1 an. 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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/Karachi (GMT+05:00)

This topic contains 1 réponse, has 2 voix.

Last updated by Waqar Il y a 1 an.

Assisted by: Waqar.

Auteur
Publications
#2583601

Hi,

i wont to give a filter in view to filter posts with a date field:

[wpv-control-postmeta field="wpcf-letzter-termin" date_format="F j, Y" url_param="wpv-wpcf-letzter-termin" default_label="bitte Datum auswählen" type="select"]

it gives all dates but in timecode. How can i format this to date_format="F j, Y" or to date_format="m Y"?

Here is a category and the date filter:
hidden link

thx for helping in acvance - alex

#2583955

Waqar
Supporter

Languages: Anglais (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi Alex,

Thank you for contacting us and I'd be happy to assist.

I found a previous ticket, where we've discussed this topic before:
https://toolset.com/forums/topic/filter-did-not-work-with-date-field

For the date type custom fields, the select type search field filter is not supported. It only allows a date picker or a text input field, which is why you're seeing the raw, timestamp values when you change the field type to "select".

The custom code snippet shared in this reply should still work to convert the timestamp text into the formatted date:
https://toolset.com/forums/topic/filter-did-not-work-with-date-field/#post-2475543

Note: You'll replace the the current field's name in that code snippet, so that this line:


jQuery('select[name="wpv-wpcf-letzter-termin_min"] option, select[name="wpv-wpcf-letzter-termin_max"] option').each(function () {

Will become:


jQuery('select[name="wpv-wpcf-letzter-termin"] option,').each(function () {

I hope this helps and please let me know if you need further assistance.

regards,
Waqar

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.