Support

Account

Home Forums ACF PRO Date Picker Displaying Wrong Start Date

Solving

Date Picker Displaying Wrong Start Date

  • The date picker is having issues on the map section.
    https://www.campnocounselors.com/locations/los-angeles/

    If you click on the pin you get the date available

    May 31 – Jun 3

    Apr 26 – Oct 30 <—wrong should be Oct 27-30

    It seems like its pulling today’s date. Can you help me solve this issue?

  • Hi @support-team

    Kindly share some more details of your setup.

    1. Which version of the plugin are you using?

    2. What are your datepicker field configurations?

    3. How are you loading the values on the map?

    Hope to hear from you soon.

  • I have the same problem. ACF pro 5.7.0 and previous version too. Website with WPML :

    I can pick the date and publish and it is saved correctly in the database…
    but when the edit (admin) page is reloaded while publishing, I get today’s date in the datepickers.
    So if I don’t pay attention and edit something else, the today’s date wipes out the date I had chosen the first time and my custom post start and end dates become today.

    Both start_date and end_date date fields currently have custom Ymd display format and 20180723 returnformat… because I was trying to debug a order by date query, and I thought there was a problem with american or french format : 31/12/2018 or 2018/12/31 or something like that. Values in database are 20181231. A forum post suggests increasing php.ini but not sure it’s relevant

  • I used HealthCheck & Troubleshooting and discovered that I had this in my child theme’s functions.php (I don’t remember why…). I removed it and saved dates are back !

    // acf date format
    function acf_smart_dates($field) {
    if ($field[‘value’]) {
    $field[‘value’] = date(‘d/m/Y’,strtotime($field[‘value’]));
    }
    return $field;
    }
    add_filter(‘acf/prepare_field/type=date_picker’,’acf_smart_dates’);

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

You must be logged in to reply to this topic.