Unable to disable the past dates in bootstrap datetimepicker
HTML
<br/> <div class="row"> <div class="col-md-12"> <h6>Datetimepicker</h6> <div class="form-group"> <div class="input-group date" id="datetimepicker"> <input type="text" class="form-control" /> <span class="input-group-addon"><span class="glyphicon-calendar glyphicon"></span></span> </div> </div> </div> </div>
JavaScript
$(function () { $('#datetimepicker').datetimepicker(); });
I also used startDate
atrribute.But no use.
Fiddle here
There is no way to disable past dates in the Calendar widget. You can look for a widget in the Appstore that has that possibility.
todayHighlight. If true, highlights the current date.
To prevent closing before clicking outside, I delete hide function like this: $('#datepicker'). data('datepicker'). hide = function () {};
startDate
option use in bootstrap-datepicker same option not mentioned anywhere in bootstrap-datetimepicker/Options/ doc it has minDate
option for that
$(function () { $('#datetimepicker').datetimepicker({ minDate:new Date() }); });
FIddle
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With