Search and Top Navigation
#4465 closed feature (wontfix)
Opened April 13, 2009 08:29PM UTC
Closed April 14, 2009 05:49AM UTC
Last modified October 11, 2012 09:15PM UTC
Add validDates option
Reported by: | f.hewitt | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | |
Component: | ui.datepicker | Version: | 1.7.1 |
Keywords: | options dates | Cc: | |
Blocked by: | Blocking: |
Description
Sometime, it's necessary to limit the user choice to some specific dates. For example, in a reservation system, it's possible that the show is available only during a few, non-consecutive days. You don't want to ask the user to click each date one by one until he find the working ones...
A validDates option, who take an array of dates is the solution.
If this parameter can be modified dynamically when the onChangeMonthYear event is fired (potentially after an Ajax call) this is just perfect.
Use the beforeShowDay setting to specify a callback function that provides this type of information. It is called once for each date displayed on the datepicker and receives that date as a parameter. It should return an array with the first entry being true if the date is selectable or false if it is not, the second item being a CSS class name (to allow highlighting the dates), and the third entry is an optional popup tooltip. See the built-in noWeekends function as an example.