var s="2006-10-23";
s=s.replace(/\-/g,"/")
var y="";
if(y.charAt(new Date(s).getDay())=='六')
{}

解决方案 »

  1.   

    我的方法有点笨啊:computeWorkingDays = function(startDate, endDate){
        var base = 1000 * 60 * 60 * 24;
        var workingDays = 0;
        while (endDate.getTime() - startDate.getTime() > 0){
            if(startDate.getDay() != 6 && startDate.getDay() != 0) {
                workingDays ++;
            }
            startDate = new Date(startDate.getTime() + base);
        }
        return workingDays;
    }
      

  2.   

    http://hi.baidu.com/slzs_zyt/item/c67b22ffd39e44763c198b44
    自己看看吧~
      

  3.   

    解决方法如下:
        $('#myCal').click(function() {
                    startDate = new Date($('#date1').val());
                    endDate = new Date($('#date2').val());
                    var base = 1000 * 60 * 60 * 24; //ms getTime()  1000*60*60*24(天)
                    var workingDays = 0;
                    while (endDate.getTime() - startDate.getTime() >= 0) {
                        if (startDate.getDay() == 6 || startDate.getDay() == 0) {//周六或周日
                            startDate = new Date(startDate.getTime() + base);                    }
                        else {
                            startDate = new Date(startDate.getTime() + base);
                            workingDays++;
                        }
                    }
                    alert(workingDays);
                });
            });