¡@

Home 

2014/10/16 ¤W¤È 12:05:41

jquery Programming Glossary: nationaldays

Can the jQuery UI Datepicker be made to disable Saturdays and Sundays (and holidays)?

http://stackoverflow.com/questions/501943/can-the-jquery-ui-datepicker-be-made-to-disable-saturdays-and-sundays-and-holid

before is it displayed. Display some national holidays in the datepicker. .selector .datepicker beforeShowDay nationalDays natDays 1 26 'au' 2 6 'nz' 3 17 'ie' 4 27 'za' 5 25 'ar' 6 6 'se' 7 4 'us' 8 17 'id' 9 7 'br' 10 1 'cn' 11 22 'lb' 12 12.. 2 6 'nz' 3 17 'ie' 4 27 'za' 5 25 'ar' 6 6 'se' 7 4 'us' 8 17 'id' 9 7 'br' 10 1 'cn' 11 22 'lb' 12 12 'ke' function nationalDays date for i 0 i natDays.length i if date.getMonth natDays i 0 1 date.getDate natDays i 1 return false natDays i 2 '_day'.. .selector .datepicker beforeShowDay .datepicker.noWeekends To combine the two you could do something like assuming the nationalDays function from above .selector .datepicker beforeShowDay noWeekendsOrHolidays function noWeekendsOrHolidays date var noWeekend..

jQuery UI Datepicker - Disable specific days

http://stackoverflow.com/questions/677976/jquery-ui-datepicker-disable-specific-days

code right Anyway most of this was taken straight from the aforementioned thread natDays 7 23 7 24 8 13 8 14 function nationalDays date for i 0 i natDays.length i if date.getMonth natDays i 0 1 date.getDate natDays i 1 return false natDays i 2 '_day'.. return true '' function noWeekendsOrHolidays date var noWeekend .datepicker.noWeekends date if noWeekend 0 return nationalDays date else return noWeekend function #datepicker .datepicker inline true minDate new Date 2009 6 6 maxDate new Date 2009..