Remove the extra comma at the end of the natDays array: change
natDays = [[2, 22, 2009],[2, 23, 2009],[2, 24, 2009],[2, 25, 2009],[2, 26, 2009],[2, 27, 2009],[2, 28, 2009],[6, 26, 2009],[6, 27, 2009],[6, 28, 2009],[6, 29, 2009],[6, 30, 2009],[7, 1, 2009],]; to natDays = [[2, 22, 2009],[2, 23, 2009],[2, 24, 2009],[2, 25, 2009],[2, 26, 2009],[2, 27, 2009],[2, 28, 2009],[6, 26, 2009],[6, 27, 2009],[6, 28, 2009],[6, 29, 2009],[6, 30, 2009],[7, 1, 2009]]; On Thu, Jan 29, 2009 at 5:22 PM, Led <[email protected]> wrote: > > IE problem http://www.realferias.com/datepik.asp?cod_casa=15 > > On 29 Jan, 06:58, Ca-Phun Ung <[email protected]> wrote: > > > > $("#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- Ocultar texto citado - > > > > - Mostrar texto citado - > > > -- 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 -~----------~----~----~----~------~----~------~--~---
