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.

3 Answers 3

8

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

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

see this fiddle

Sign up to request clarification or add additional context in comments.

1 Comment

@HalfBloodPrince, momet() is from the date library moment.js
2

Try this. it disables past date and time.

 $(function () { $('#datetimepicker').datetimepicker({ startDate: new Date() }); }); 

Comments

1

Try to use

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

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.