Support Forums

The forums are closed and will be removed when we launch our new site.

Looking for support? You can access the support system via your account.

Forums Forums Search & Filter Pro problem with Date picker

Tagged: ,

Viewing 5 posts - 1 through 5 (of 5 total)
  • Yerbol Izbassarov
    #17723

    First of All thanks!
    I just have one problem with Date picker.

    My fields plugin saves data in 31.12.2015 text format i think.

    and in your filters with Date, there is no such format option.
    How do you think, will it be possible to add DD.MM.YYYY format, and will it support the date range filter?
    Best regards.

    Ross Moderator
    #18011

    Hey Yerbol

    I think you will need to change the way it is saving the dates.

    This is pretty simple really but it because of the way MySQL can search (and order) dates.

    A timestamp is a valid time format, and MySQL knows how to sort this.

    The format of YYYYMMDD is also a valid date, but it is also a number – which can be used for sorting.

    With the dots in between:

    DD.MM.YYYY you actually have a string, a string cannot be searched by MySQL efficiently as date, this field will first need to be transformed to something understandable by MySQL otherwise its not possible.

    Hope that makes sense.

    Thanks

    Yerbol Izbassarov
    #20724

    Hi, at the time WP date date format is 04/07/2015

    I set up 2 filters:Post Data and Post Meta. http://rabotu.kz/resume-map/#s=1

    For Post Date-> Data Range->Date Format->03/07/2015
    it is not filtering my posts.

    FOR Post meta – _cadidate_birthday meta key is found, my settings are: Date Range, Timestamp 03/07/2015 Date display Format.

    The problem is that the plugin is not filtering the posts. Despite I am using the 04/07/2015 standard date format.

    The search query is like this – http://rabotu.kz/search/?_sfm__candidate_birthday=01072012+08072015#s=1

    The filter works only if I change WP date format to – CUSTOM 04072015 but it is looking not good on the site.

    Ross Moderator
    #21013

    Hi Yerbol, you must use the custom format because the other format with / is not searchable – this is just the way databases work, you can’t compare a date when in fact it is a string.

    What I would suggest is to read up on the date format functions – which will allow for a better display in your theme – https://codex.wordpress.org/Formatting_Date_and_Time

    Thanks

    Yerbol Izbassarov
    #21039

    Thanks, I understood the problem.
    Custom paid plugin on my site is using my WP Date format. It is dd/mm/yyyy but WP saves it as Timestamp format, while the plugin is saving it in dd/mm/yyyy format. I asked the paid plugin developer to fix it, but he is not responding yet.

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

The forum ‘Search & Filter Pro’ is closed to new topics and replies.