• I’m trying to restrict the ability to choose certain dates with the datepicker add-on. I’m assuming this is easy, but I can’t seem to find a way to manipulate the edit screen. It should be a minDate and maxDate value as detailed here

    http://jqueryui.com/datepicker/#min-max

    <script>
    $(function() {
    $( "#datepicker" ).datepicker({ minDate: -20, maxDate: "+1M +10D" });
    });
    </script>

    I’ve searched through the plugins ‘datepicker’ core files and can’t seem to find where exactly to add the code in.

    If anyone can help me or show me how to implement taht would be greatly appreciated.

    Thanks!

    https://wordpress.org/plugins/advanced-custom-fields/

Viewing 1 replies (of 1 total)
  • They have made it a little tricky for us to do just what you want, but I’ve found where to put this.

    It is in advanced-custom-fields/core/fields/date_picker/date_picker.php. Line 63 look like this:

    'isRTL'             => isset($wp_locale->is_rtl) ? $wp_locale->is_rtl : false,

    Right below that, add in this:

    'minDate'             => '-20',
    'maxDate'             => '+1M +10D'
Viewing 1 replies (of 1 total)
  • The topic ‘Datepicker Range’ is closed to new replies.