I wanted to disable all past date before current date, not with current date. I am trying by bootstrap datepicker library \"bootstrap-datepicker\" and using following code:<
In html
<input class="required form-control" id="d_start_date" name="d_start_date" type="text" value="">
In Js side
<script type="text/javascript">
$(document).ready(function () {
var dateToday = new Date();
dateToday.setDate(dateToday.getDate());
$('#d_start_date').datepicker({
autoclose: true,
startDate: dateToday
})
});
HTML
<input type="text" name="my_date" value="4/26/2015" class="datepicker">
JS
jQuery(function() {
var datepicker = $('input.datepicker');
if (datepicker.length > 0) {
datepicker.datepicker({
format: "mm/dd/yyyy",
startDate: new Date()
});
}
});
That will highlight the default date as 4/26/2015 (Apr 26, 2015) in the calendar when opened and disable all the dates before current date.