bootstrap datepicker js disable future dates

18,846

try the following

$(document).ready(function(){
    $('.datepicker').datepicker({
        format: 'mm-dd-yyyy',
        endDate: '+0d',
        autoclose: true
    });
});
Share:
18,846
Karthick
Author by

Karthick

Updated on June 04, 2022

Comments

  • Karthick
    Karthick almost 2 years

    I want disable future dates only on bootstrap datepicker.I had tried but can't resolve this problem.Anybody help!

    This is my code

    ready = function(){
    $('.datepicker').datepicker({
          format: 'mm-dd-yyyy',
          endDate: '+0d',
          autoclose: true
      });
    };
    $(document).ready(ready);
    $(document).on('page:load', ready);