Reputation: 1409
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.
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?
Upvotes: 0
Views: 397
Reputation: 214
try using this:
$(document).ready(function(){
$( "#datepicker" ).datepicker({
dateFormat: "yy-mm-dd",
startDate: new Date('2020-11-30')
});
});
Upvotes: 1