Forums Forums Search & Filter Pro Custom Date Input Format

Viewing 2 posts - 1 through 2 (of 2 total)
  • Anonymous
    #8398

    Hi,

    I’ve got a custom post type (events) with a custom meta value – date. I’d like to use S&F Pro to filter a custom date range and display the applicable events this way.

    However – my dates are saved as YYYY-MM-DD and aren’t displaying as the search form only allows for YYYYMMDD or Timestamp. How would I go about solving this/adding a custom date input format?

    Any help would be highly appreciated!

    Thank you in advance

    Ross Moderator
    #8400

    Hey Tim

    Unfortunately you must change the way your dates are being saved.

    Storing the dates as YYYYMMDD – would results in a date like 20141130 – the advantage of this, and why this is required is because this format the date is actually a number, so we can do compares and range comparisons – ie – search for a date range.

    The format you highlight has hyphens, and it means it is not a number – which means in the database you can’t do a compare such as “between” 2014-11-30 and 2014-11-01 – because these are not number the comparison can’t be made.

    Hope that makes sense

    Thanks

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