Here's an example I had sitting around in one of my code:

$('.selector').datepicker({
    beforeShowDay: expiration_dates
});


function expiration_dates(date) {
    // list of dates that are selectable
    // this list of dates were generated on server-side
    // it's the same format you get with date.getTime()
    var expirations =
[1231322400000,1231927200000,1232532000000,1233136800000,1233741600000,1234346400000,1234951200000,1235556000000,1236160800000,1236765600000,1237370400000,1237975200000];
    var day = date.getTime();
    for (var i=0; i<expirations.length; i++) {
        if (day == expirations[i]) return [true, ''];
    }
    return [false, ''];
};


On Jul 6, 11:29 am, Developr <[email protected]> wrote:
> Would it be possible to supply a working example I can view?  My
> jQuery skills are novice at best.
>
> TIA
>
> On Jun 26, 9:52 am, Fontzter <[email protected]> wrote:
>
> > There is a beforeShowDay event that you can use to evaluate the date
> > and decide whether to enable it or not.
>
> >http://jqueryui.com/demos/datepicker/#event-beforeShowDay
>
> > 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.
> > Code examples
>
> > Supply a callback function to handle the beforeShowDay event as an
> > init option.
>
> >     $('.selector').datepicker({
> >        beforeShowDay: function(date) { ... }
> >     });
>
> > Hth,
>
> > Dave
>
> > On Jun 25, 3:26 pm, Developr <[email protected]> wrote:
>
> > > Any way to provide a array of dates that cannot be selected?  I know
> > > there is the min/max, but I need to just disable certain dates in the
> > > middle of a range.
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jQuery UI" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/jquery-ui?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to