Support

Account

Home Forums Backend Issues (wp-admin) Datepicker not appearing

Solved

Datepicker not appearing

  • Since updating ACF from 4.4.1 to 5.7.10 the datepickers in my custom fields don’t work…

    When activating the date field I get a console error saying:
    Firefox

    too much recursion jquery-ui-timepicker-addon.min.js:1:1
    $.datepicker._updateDatepicker
    /wp-content/plugins/advanced-custom-fields/assets/inc/timepicker/jquery-ui-timepicker-addon.min.js:1:1
    $.datepicker._updateDatepicker
    /wp-content/plugins/advanced-custom-fields/assets/inc/timepicker/jquery-ui-timepicker-addon.min.js:1:29961
    $.datepicker._updateDatepicker
    /wp-content/plugins/advanced-custom-fields/assets/inc/timepicker/jquery-ui-timepicker-addon.min.js:1:29961
    $.datepicker._updateDatepicker
    /wp-content/plugins/advanced-custom-fields/assets/inc/timepicker/jquery-ui-timepicker-addon.min.js:1:29961
    $.datepicker._updateDatepicker
    /wp-content/plugins/advanced-custom-fields/assets/inc/timepicker/jquery-ui-timepicker-addon.min.js:1:29961
    ............. (repeated for a page or so )
    

    Chrome

    jquery-ui-timepicker-addon.min.js?ver=1.6.1:1 Uncaught RangeError: Maximum call stack size exceeded
        at c.$.datepicker._updateDatepicker [as _base_updateDatepicker] (jquery-ui-timepicker-addon.min.js?ver=1.6.1:1)
        at c.$.datepicker._updateDatepicker [as _base_updateDatepicker] (jquery-ui-timepicker-addon.min.js?ver=1.6.1:1)
        at c.$.datepicker._updateDatepicker [as _base_updateDatepicker] (jquery-ui-timepicker-addon.min.js?ver=1.6.1:1)
        at c.$.datepicker._updateDatepicker [as _base_updateDatepicker] (jquery-ui-timepicker-addon.min.js?ver=1.6.1:1)
        at c.$.datepicker._updateDatepicker [as _base_updateDatepicker] (jquery-ui-timepicker-addon.min.js?ver=1.6.1:1)
        at c.$.datepicker._updateDatepicker [as _base_updateDatepicker] (jquery-ui-timepicker-addon.min.js?ver=1.6.1:1)
        at c.$.datepicker._updateDatepicker [as _base_updateDatepicker] (jquery-ui-timepicker-addon.min.js?ver=1.6.1:1)
        at c.$.datepicker._updateDatepicker [as _base_updateDatepicker] (jquery-ui-timepicker-addon.min.js?ver=1.6.1:1)
        at c.$.datepicker._updateDatepicker [as _base_updateDatepicker] (jquery-ui-timepicker-addon.min.js?ver=1.6.1:1)
        at c.$.datepicker._updateDatepicker [as _base_updateDatepicker] (jquery-ui-timepicker-addon.min.js?ver=1.6.1:1)
    $.datepicker._updateDatepicker @ jquery-ui-timepicker-addon.min.js?ver=1.6.1:1
    $.datepicker._updateDatepicker @ jquery-ui-timepicker-addon.min.js?ver=1.6.1:1
    $.datepicker._updateDatepicker @ jquery-ui-timepicker-addon.min.js?ver=1.6.1:1
    $.datepicker._updateDatepicker @ jquery-ui-timepicker-addon.min.js?ver=1.6.1:1
    $.datepicker._updateDatepicker @ jquery-ui-timepicker-addon.min.js?ver=1.6.1:1
    ............
    

    I can see two references to datepicker in the loaded JS sources

    
    <script type='text/javascript' src='/wp-includes/js/jquery/ui/datepicker.min.js?ver=1.11.4'></script>
    <script type='text/javascript'>
    jQuery(document).ready(function(jQuery){jQuery.datepicker.setDefaults({"closeText":"Close","currentText":"Today","monthNames":["January","February","March","April","May","June","July","August","September","October","November","December"],"monthNamesShort":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],"nextText":"Next","prevText":"Previous","dayNames":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],"dayNamesShort":["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],"dayNamesMin":["S","M","T","W","T","F","S"],"dateFormat":"MM d, yy","firstDay":1,"isRTL":false});});
    </script>
    <script type='text/javascript' src='/wp-content/plugins/advanced-custom-fields/assets/inc/timepicker/jquery-ui-timepicker-addon.min.js?ver=1.6.1'></script>
    

    Couldn’t find anyone referencing the same problem online – I have deactivated as many plugins as I dare to see if something’s double loading JS side. No joy as it seems that it’s core WP loading it from includes first.

  • The issue here is the script jquery-ui-timepicker getting enqueued twice – again from another plugin.

    For lack of a better option I just commented out the enqueued script directly in the plugin file…

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

The topic ‘Datepicker not appearing’ is closed to new replies.