Reputation: 63
I want to use the datepicker to choose dates for an online hotel booking tool. I need to have a picker without any predefined "default" date, to let the user do it. At the same time, I want to use the minDate functionality to not let my user choose a date in the past. At this moment, I solved this problem with a very unpleasant hack of the datepicker source code - so, I won't be able to update it, and I really don't like such hacks. Is there a reasonnable, "human" way to do this? I have killed hours working on the question and did not find any working solution.
Upvotes: 4
Views: 8808
Reputation: 11096
Once the datepicker is defined and initialized, you can use .datepicker( "setDate" , null )
to clear out the default date.
http://api.jqueryui.com/datepicker/#method-setDate
NOTE This is not the same as setting the defaultDate
option...
Upvotes: 3