Skip Navigation

[Resolved] Filter results with a ACF date and Views datepicker

This support ticket is created 6 years, 3 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.

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.

This topic contains 2 replies, has 2 voices.

Last updated by FrancoisJ6057 6 years, 2 months ago.

Author
Posts
#1096946
View  Programmes ACF   Formation Mauricie.png

Hi,

I've used ACF to create my custom fields (yes, I know I could use Types, but for many reasons, I use ACF).
The ting is when I want to do a custom search, I cannot filter the results.

Views show me the date in a WP format (j F Y in ma case, which is correct. Ex. 30 aout 2018 in french). ACF return me a dmy PHP format (ex. : 30082018). So when I try to limit/filter the results, it doesn't work.

I suppose I need to change the way the date is stored? Or do I only need to display it in the good format?
I actually use [wpv-post-field name="demarrage"] shortcode. Can I format it directly, or do I have to create a php function somewhere?

#1097352
Bildschirmfoto 2018-09-01 um 14.07.15.png

You can just change the Date Filter Query in the View to "Number" to make it work

In the Query Filter section of the View, the Date Filter is editable. There, pick the number option.

Since ACF will return a Timestamp the values will now be compared as numeric, so it should work.

#1099557

Thanks Beda, but doesn't seem to work either... I think I will use Toolset fields for the "dates" instead. It might be easier.