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.
Asked
Active
Viewed 9,666 times
3 Answers
8
Setting the minDate option is what I would recommend minDate: moment()
$('#datetimepicker1').datetimepicker({
minDate: moment()
});

Jason Tate
- 606
- 1
- 7
- 10
-
1@HalfBloodPrince, `momet()` is from the date library [moment.js](http://momentjs.com/) – Adam Azad Jul 09 '16 at 18:59
2
Try this. it disables past date and time.
$(function () {
$('#datetimepicker').datetimepicker({
startDate: new Date()
});
});

Shiplu
- 460
- 6
- 13