<script>
function isSat(s){
return new Date(s).getDay() == 6;
}
document.write(isSat("2004/09/25"))
document.write(isSat("2004/09/27"))
</script>

解决方案 »

  1.   

    agree with  fason(Forbes Pu)
      

  2.   

    getDay 方法
    请参阅
    Date 对象的方法 | getUTCDay 方法应用于: Date 对象
    要求
    版本 1
    返回 Date 对象中用本地时间表示的一周中的日期值。dateObj.getDay()
    必选项 dateObj 参数为 Date 对象。说明
    要获取用全球标准时间 (UTC) 表示的一周中日期值,请使用 getUTCDay 方法。getDay 方法所返回的值是一个处于 0 到 6 之间的整数,它代表了一周中的某一天,返回值与一周中日期的对应关系如下: 值 星期 
    0 星期天 
    1 星期一 
    2 星期二 
    3 星期三 
    4 星期四 
    5 星期五 
    6 星期六 下面这个例子说明了 getDay 方法的用法。function DateDemo(){
       var d, day, x, s = "今天是: ";
       var x = new Array("星期日", "星期一", "星期二");
       var x = x.concat("星期三","星期四", "星期五");
       var x = x.concat("星期六");
       d = new Date();
       day = d.getDay();
       return(s += x[day]);
    }
      

  3.   

    <script language="javascript">
    <!--
    function GetDOW(dd)  
      {
        var dt=new Date(dd).getDay();
        return dt;
      }function IsWeekend(d)
    {
        if (GetDOW(d) == 0 || GetDOW(d) == 6){
        return true;
        }else
        {
        return false;
        }
    }
    //-->
    </script>
      

  4.   

    function isWeekEnd(dstr){
    //dstr 的形式是'2004/10/1'
      if((new Date(dstr)).getDay()==5) return true;
      else return false;
    }