3

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.

rash111
  • 1,307
  • 4
  • 19
  • 35

3 Answers3

8

Setting the minDate option is what I would recommend minDate: moment()

$('#datetimepicker1').datetimepicker({
    minDate: moment()
});

see this fiddle

Jason Tate
  • 606
  • 1
  • 7
  • 10
2

Try this. it disables past date and time.

 $(function () {
   $('#datetimepicker').datetimepicker({
      startDate: new Date()
   });
});
Shiplu
  • 460
  • 6
  • 13
1

Try to use

$('#datetimepicker1').datetimepicker({
    minDate: new Date()
});