> > $("#Text1").datepicker({ beforeShowDay:  nationalDays,showOtherMonths:
> > true,showWeeks: true, firstDay: 7,changeFirstDay: false});
> >
> > function nationalDays(date) {
> >     for (i = 0; i < natDays.length; i++) {
> >       if (date.getMonth() == natDays[i][0] - 1
> >           && date.getDate() == natDays[i][1]
> >           && date.getFullYear() == natDays[i][2]) {
> >         return [false, natDays[i][0][1] ];
> >
> >         $(".ui-datepicker-days-cell").addclass("desocupa");
> >
> > }
> >
> >     }
> >   return [true, ''];
> >
>

Ah I see what you're trying to do now. Try this:

function nationalDays(date) {
  for (i = 0; i < natDays.length; i++) {
    if (date.getMonth() == natDays[i][0] - 1
        && date.getDate() == natDays[i][1]
        && date.getFullYear() == natDays[i][2]) {
        return [false, natDays[i][0][1] ];
    }
  }
  return [true, 'desocupa'];
}

This will add the "desocupa" class to non-nationalDays. If you want the
additional class for national days you'd need to change

return [false, natDays[i][0][1] ];

to

return [false, 'desocupa' ];


> i can see this comment in datepicker.js and i don't understand ---
> beforeShowDay: null, // Function that takes a date and returns an
> array with
>                       // [0] = true if selectable, false if not, [1] =
custom CSS class
> name(s) or '',
>                       // [2] = cell title (optional), e.g. $.datepicker
.noWeekends

These specify the return values of the beforeShowDay callback. In your case
the function is nationalDays. i.e.

function nationalDays {
  return [ {selectable}, {custom-css}, {custom-cell-title} ];
}

-- 
Ca-Phun Ung
+ http://yelotofu.com
+ hongkong, zce, jquery, php, css, html

--~--~---------~--~----~------------~-------~--~----~
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