Forums › Forums › Search & Filter Pro › Acf type date and search filter
Tagged: acf date search and filter
- This topic has 9 replies, 2 voices, and was last updated 4 years, 10 months ago by
Trevor.
-
Anonymous(Private) June 9, 2020 at 4:32 pm #248059
Hello,
I use ACF and Search and Filter Pro for a “calendar like”.
I have a ACF field type : date (event-date).
I have a Search And Filter form and i use this meta key (event-date) in a dropdown element.The problem i have :
https://prnt.sc/swnklv
The display of the date in the dropdown element is différent than the get_field function. I want “10/06/2020” not “20200610”. Where can i change this setting ? I check the ACF config, but the display is correct : https://prnt.sc/swnm3tCan you help me please ?
Trevor(Private) June 9, 2020 at 5:34 pm #248088I need to see a screenshot of the setup of the field in our Form UI. I can use the other screenshot you already sent, but I need to translate it to English. One of the settings must be changed to
Ymd
, I think, but I will wait until I see this other screenshot.Please note that it is late here in the UK (gone 5PM) and we are closed now for the day, so I will likely not reply until tomorrow.
Anonymous(Private) June 9, 2020 at 6:32 pm #248104Hi
Here the screenshot of the Form UI : https://prnt.sc/swpwq7
Trevor(Private) June 10, 2020 at 9:05 am #248152The problem that you face is that ACF always stores dates in the YYYYMMDD format (as you see) and the Choice option you have used will show that format.
The Date option in the field setup is a datepicker, and I guess that is not what you want?
The only alternative is to use this filter:
https://searchandfilter.com/documentation/action-filter-reference/#filter-input-object
To change these labels. This post, from our developer, Ross, shows something similar being done:
https://support.searchandfilter.com/forums/topic/change-date-format-in-choice-tab/#post-230093
I suspect you could use that code (or slightly modify it) to get what you want.
-
AuthorPosts