JQuery DatePicker - Only Select Certain Dates?

I’m using JQuery and the DatePicker (or trying to) and have hit a brick wall.

I can’t seem to figure out how to provide a list of acceptable dates. I know there is a way to provide a date range but I want to provide a list of dates that can be selected.

I.e. there may be only Thursdays and Fridays, so this month the acceptable dates would be:

8/6/2009
8/7/2009
8/13/2009
8/14/2009
8/20/2009
8/21/2009
8/27/2009
8/28/2009

I’d like ONLY those dates to be able to be selected. Is this possible? If so, how would I configure the datepicker?

Thanks

The datepicker has an event beforeShowDay.

In the documentation it says

" The function takes a date as a parameter and must return an array with [0] equal to true/false indicating whether or not this date is selectable, [1] equal to a CSS class name(s) or ‘’ for the default presentation and [2] an optional popup tooltip for this date. It is called for each day in the datepicker before is it displayed. "

So if you return an array with the first element set to false for days that are not selectable and true for days that are, that should do the trick. You can also indicate css classes in the 2nd element of the array to do for example a strike-through of non-selectable dates.

See: http://jqueryui.com/demos/datepicker/ in the section Events

Thanks, I think that will do the trick!