How to disable Bootstrap datetimepicker

Viewed 16859

I am using the Bootstrap datatimepicker (https://eonasdan.github.io/bootstrap-datetimepicker/). I'd like to disable the datetimepicker on page load.

$(document).ready(function () {
    $('#datetimepicker1').datetimepicker({
        defaultDate: new Date(),
        format: 'DD/MM/YYYY hh:mm:ss A'
    });
});

<div class='input-group date' id='datetimepicker1'>
    <input type='text' class="form-control" />
    <span class="input-group-addon">
        <span class="glyphicon glyphicon-calendar"></span>
    </span>
</div>

I have tried $('#datetimepicker1').prop('disabled', true) and $('#datetimepicker1').disable() from (http://eonasdan.github.io/bootstrap-datetimepicker/Functions/#disable). Neither work. So what is the best way to do it?

3 Answers
Related