Jquery datepicker without any predefined default date?

I want to use datepicker to select dates for online hotel reservations. I need to have a collector without any predefined default date so that the user can do this. At the same time, I want to use the minDate function so that my user does not select a date in the past. At this point, I solved this problem with a very nasty hack of the datepicker source code, so I can’t update it, and I really don’t like these hacks. Is there any reasonable, “human” way to do this? I killed hours of work on the issue and did not find any working solution.

+4
source share
1 answer

After defining and initializing the datepicker, you can use .datepicker( "setDate" , null ) to remove the default date.

http://api.jqueryui.com/datepicker/#method-setDate

NOTE This is not the same as setting the defaultDate ...

+3
source

Source: https://habr.com/ru/post/1387214/


All Articles