Opened 11 years ago

Closed 11 years ago

Last modified 7 years ago

#4465 closed feature (wontfix)

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.

Change History (2)

comment:1 Changed 11 years ago by kbwood

Resolution: wontfix
Status: newclosed

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.

comment:2 Changed 7 years ago by Scott González

Milestone: TBD

Milestone TBD deleted

Note: See TracTickets for help on using tickets.