Forums Forums Search & Filter Pro search form with post POST META (date and time)

Viewing 7 posts - 1 through 7 (of 7 total)
  • Anonymous
    #3075

    Hi,
    I have a problem in a search form with post meta field.

    I use:

    1. WordPress 3.8.3
    2. Search & Filter Pro plugin 1.1.6
    3. Custom fields (Date and Time in this format mm/dd/yy) created by Custom Content Type Manager : Advanced Custom Post Types (Vers 0.9.7.13)

    The filter works perfectly but if I add a POST META field by search it is ignored.

    What there can be a problem?

    Anonymous
    #3077

    Please! Help me ASAP!

    Ross Moderator
    #3079

    Hey gianfranco – what format is the date stored in the database? The date must be stored as either a timestamp, or YYYYMMDD – these are the only formats for saving in the database that are supported currently.

    Anonymous
    #3088

    The data was stored as YYYY-MM-DD, so it didn’t work with Search & Filter Pro.
    Now I’m trying to store my custom data field without “-“, and it seem to work now.

    Thank you for your help!

    Ross Moderator
    #3097

    Thats great to hear 🙂

    Anonymous
    #3243

    Just to know…
    would be difficult to add a new date format, or to edit an existing date format?

    Ross Moderator
    #3386

    Hey gianfranco

    Do you mean the display format from the plugin, or the backend format that is saved in the database? Frontend is not too difficult..

    The date format in the backend must match a format that can be compared numerically directly from the database – so we can perform searches.

    For example if you wanted to find posts within a date range, then the database query would look something like (this is extremely simplified):

    SELECT * FROM 'posts' WHERE datefield < '20140601' AND datefield > '20130101'

    Basically we have to be able to use operators like “greater than” and “less than” and this is only possible with numbers – not strings (so you cannot add regular characters such as hyphens).. this is also possible with a unix timestamp which is currently supported.

    Does that make sense?

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