bootstrap datepicker disable past months code example
Example: bootstrap-datepicker disable dates from another month
DatePicker = {
hideOldDays: function(){
var x = $('.datepicker .datepicker-days tr td.old');
if(x.length > 0){
x.css('visibility', 'hidden');
if(x.length === 7){
x.parent().hide();
}
}
},
hideNewDays: function(){
var x = $('.datepicker .datepicker-days tr td.new');
if(x.length > 0){
x.hide();
}
},
hideOtherMonthDays: function(){
DatePicker.hideOldDays();
DatePicker.hideNewDays();
}
};
$('.datepicker').datepicker().on('show', function(e) {
DatePicker.hideOtherMonthDays();
});