I'm using Bootstrap datepicker and I want to inactive previous date. Means the user should not be able to select the previous day. I want this to develop functionality to schedule some users work.
What I need to do?
I'm using Bootstrap datepicker and I want to inactive previous date. Means the user should not be able to select the previous day. I want this to develop functionality to schedule some users work.
What I need to do?
The following code will disable date after today.
var nowTemp = new Date();
var now = new Date(nowTemp.getFullYear(), nowTemp.getMonth(), nowTemp.getDate(), 0, 0, 0, 0);
$('#myId').datepicker({
format: 'dd-mm-yyyy',
onRender: function(date) {
return date.valueOf() > now.valueOf() ? 'disabled' : '';
}
});