[CustomPress] Datepicker field stored in db in frontend format

I have a custom post type with a custom field, a date through the datepicker option. Looks nice.
I am using a filter plugin to select on this date. This filter plugin returns the results in ascending date order.
But... 10-03-2019 (March 10) comes before 24-02-2019 (Feb 24). Looking in the database, it turns out that the dates are actually stored in the format as shown on screen. To me, showing on screen and storing in the database are 2 different stories. In the database it should always be stored in yyyymmdd format.

The date in the filter plugin is used as start date, to filter the custom posts with date greater or equal this start date. That obviously won't work when the date is stored this way in the database.

Hence my question: can the date in the database be stored in yyyymmdd format, please?

  • Adam Czajczyk
    • Support Gorilla

    Hi mpress

    I hope you're well today!

    There's a format setting for the date in CustomPress and that format would be used for both front-end and back-end.

    However, I do get your point on this. It would require some additional customization but I'm not sure whether it could be possible currently without doing some serious changes to the plugin's core. What would have to be done would be to convert the date "back & forth" between formats - one selected for the field and the "db one" as you suggested - on the fly upon saving/updating the field and upon reading it so if there are some filter/action hooks available, that should be doable.

    I've asked our developers for consultation and am awaiting their response on this so please keep an eye on this ticket and we'll update you here as soon as we get to know more from them.

    Kind regards,
    Adam

  • Tho Bui
    • Staff

    Hi mpress,

    I hope you’re well today!

    Regarding your issue, our developers are already working on this. In the meantime, all you need to do is download the attached file, unzip it and place it inside plugins folder /wp-content/plugins/, replace as new one.

    Before apply any change, please make sure to have a COMPLETE and UPDATED BACKUP of the site.

    Have a nice weekend!

    Kind regards,
    Thobk

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.