datepicker 限制日期

摘要:datepicker 限制日期


 beforeShowDay: function(date){ 
     var day = date.getDay();
     var month = date.getMonth(); 
     var d = date.getDate();
     if(month!=0){
      return [day != 0 && day != 6,''];
     }else{
       return [day != 0 && day != 6 &&  d != 15,''];
     }
   }



function disableDays(date) {
            for (i = 0; i < 3; i++) {
                var disDays = ["1" + i + "/1/2012"];
                var sDate = date.getDate().toString() + "/" + (date.getMonth() + 1).toString() + "/" + date.getFullYear().toString();
                if ($.inArray(sDate, disDays) != -1) {
                    return [false];
                }
                else {
                    if (date.getDay() == 1) {

                        return [false];
                    }
                }
            }
             return [true];           
        }