0

We want users to pick any date starting Nov. 30, 2020. I'm using the following script to set up the minDate on the JQuery datepicker.

$(function() {
  $( "#datepicker" ).datepicker({
    dateFormat: "yy-mm-dd",
    minDate: new Date('2020-11-30'),
  });
});

The problem is that when I try the picker, the first date available is November 29 instead of November 30.

datepicker image

I have tried setting different dates but the previous date is always available. However, if I set the date to 2020-12-1 then it works.

What am I missing?

cesarcarlos
  • 1,271
  • 1
  • 13
  • 33

1 Answers1

1

try using this:

$(document).ready(function(){
   $( "#datepicker" ).datepicker({
      dateFormat: "yy-mm-dd",
      startDate: new Date('2020-11-30')
    });
});
John Clinton
  • 204
  • 1
  • 6