0

I want to disable previous dates from datepicker.I have used the following code snippet

$("#check_In_Date").datepicker({ minDate: 0 });

But does not work.But when I use format properties it works just fine. Any help please how do i work around that is much appreciated.

HaveNoDisplayName
  • 8,291
  • 106
  • 37
  • 47
alluma
  • 7
  • 8
  • 1
    Does this answer your query, http://stackoverflow.com/questions/16123056/bootstrap-datepicker-disabling-past-dates-without-current-date – sammry Aug 21 '15 at 23:48
  • Yes looks like duplicate of the above link. The simplest solution is `$('#check_In_Date').datepicker({ minDate: moment(), });` I pass more options to mine but this example fits on one line so just putting the relevant one. Got this answer from someone else on the link but it was hard to spot! – user7247147 Dec 26 '19 at 05:31
  • Does this answer your question? [Bootstrap datepicker disabling past dates without current date](https://stackoverflow.com/questions/16123056/bootstrap-datepicker-disabling-past-dates-without-current-date) – user7247147 Dec 26 '19 at 05:32

2 Answers2

0

$("#check_In_Date").datepicker({ minDate: new Date() });

This will work for you.

Jun Aid
  • 464
  • 7
  • 16
0
$("#check_In_Date").datepicker({ 
    startDate: new Date()
});
Rajeev
  • 312
  • 3
  • 10