I want to disable all the future dates in the calendar. To do that, I am setting endDate: new Date(). Today is 12th January 2021. So all the dates after 12th January 2021 should be disabled. But the problem is I am getting all the months of 2021 including January disabled. I do not understand why I am getting January month disabled. endDate is 12/01/2021 (MM/DD/YYYY). So date time picker should allow January month. Here is my code.
setTimeout(function(){
jQuery('#startday').datetimepicker({
format: 'mm/dd/yyyy',
autoclose: true,
startView: 'year',
minView: 'month' ,
endDate:new Date()
});
},1000);
Screenshot
I am using bootstrap-datetimepicker.min verion 3.3.6. Bootstrap version 3.3.2.