Search code examples
javascriptdatetimepicker

Bootstrap 3 datetimepicker v4 disable dates


I am working on a datetimepicker and want to disable all the future dates except today, here is my code:

$('#textFromDate').datetimepicker(function () {   
  maxDate:new Date()
  autoclose: true
});

Thanks in advance.


Solution

  • Yes Finally I have googled the working Answer.......

    $("#textFromDate").datetimepicker( {       
        format: 'MM/DD/YYYY',                   
        ignoreReadonly: true,
        maxDate: 'now'     
    });