How do I disable dates before today in jQuery datepicker WITHOUT using minDate: 0?
I would like to enable navigation of the calendar as per usual before today while making sure that user do NOT pick dates before today.
(i.e. say today’s date is 11Aug11 and I would like all the dates before this disabled but still enabling user to go to previous months, years, etc.)
While I agree that it’s weird behavior, you might be able to fake it using the
onSelectevent of the datepicker.Basically, you handle the
onSelectevent.When a date is selected, check to see if it’s before today’s date.
If it is, then you immediately show the datepicker again and clear out the input box attached to it.
Updated
Code sample is now completely functional. Here’s a jsfiddle to demonstrate.