Forums Forums Search & Filter Pro Acf type date and search filter

Viewing 10 posts - 1 through 10 (of 10 total)
  • Anonymous
    #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/swnm3t

    Can you help me please ?

    Trevor
    #248080
    This reply has been marked as private.
    Anonymous
    #248084
    This reply has been marked as private.
    Trevor
    #248088

    I 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
    #248104

    Hi

    Here the screenshot of the Form UI : https://prnt.sc/swpwq7

    Trevor
    #248152

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

    Anonymous
    #248265

    Thks.

    Ok, i’m gonna try, I let you know 🙂

    Trevor
    #248267

    OK. I will leave this thread open and await your update on progress.

    Anonymous
    #250005

    Finally the artistic direction decided to change the types of filters to display. But I keep the links just in case! Thanks you.

    Trevor
    #250024

    Thanks for letting me know. I will close this thread for now.

Viewing 10 posts - 1 through 10 (of 10 total)