Reputation: 1317
I am using Bootsrap 3 (eonasdan-datetimepicker) Datetime Picker. I am wondering how can i prevent user to select past time. I find the documentation doesn't say much about how to disable past time.
Upvotes: 3
Views: 9911
Reputation: 11
Try to use
$('#datetimepicker1').datetimepicker({
minDate: new Date()
});
Upvotes: 1
Reputation: 516
Try this. it disables past date and time.
$(function () {
$('#datetimepicker').datetimepicker({
startDate: new Date()
});
});
Upvotes: 2
Reputation: 716
Setting the minDate option is what I would recommend minDate: moment()
$('#datetimepicker1').datetimepicker({
minDate: moment()
});
Upvotes: 8