效果如上,週六週日是不能選擇的,spa
js代碼:code
$(function() { $("#datepicker").datepicker({ dateFormat: 'yy-mm-dd', beforeShowDay:showWeeksSpSelect, minDate: '1' }); });
有個方法:showWeeksSpSelectorm
function showWeeksSpSelect(date){ var day = date.getDay(); var weeks=1#2#3#4#5#6 //週日爲0 var b=weeks.indexOf(day); return [(b>=0), '']; }