Skip Navigation

[Gelöst] format filter date selectfield

This support ticket is created vor 1 Jahr, 8 Monaten. 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.

Heute stehen keine Supporter zur Arbeit im Werkzeugsatz-Forum zur Verfügung. Sie können gern Tickets erstellen, die wir bearbeiten werden, sobald wir online sind. Vielen Dank für Ihr Verständnis.

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)

Dieses Thema enthält 1 Antwort, hat 2 Stimmen.

Zuletzt aktualisiert von Waqar vor 1 Jahr, 8 Monaten.

Assistiert von: Waqar.

Author
Artikel
#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:
versteckter Link

thx for helping in acvance - alex

#2583955

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