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
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