function getweek(time) { /*显示星期*/ /*time为date格式*/ var str; var d = time.getDay(); switch (d) { case 0: str = 0; break; case 1: str = 1; break; case 2: str = 2; break; case 3: str = 3; break; case 4: str = 4; break; case 5: str = 5; break; case 6: str = 6; break; } return str; }