0

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

enter image description here

I am using bootstrap-datetimepicker.min verion 3.3.6. Bootstrap version 3.3.2.

Manoj
  • 2,059
  • 3
  • 12
  • 24
  • From the docs. [BS Datepicker EndDate](https://bootstrap-datepicker.readthedocs.io/en/latest/options.html#enddate) `` will disable all dates after today. – Raja Jan 13 '21 at 08:10
  • Refer to this post https://stackoverflow.com/questions/22006328/disable-future-dates-after-today-in-jquery-ui-datepicker – Red Black Jan 13 '21 at 08:21

0 Answers0