日期:2014-05-16 浏览次数:20355 次
<script language="javascript"> var src="张三,李四,王五,赵六,钱七,孙八,曾久" var srcArray=src.split(",") var beginDate=new Date(2008,3,26) var nowdate=new Date() var diff=Math.floor((nowdate-beginDate)/(86400000*7)) diff=diff%srcArray.length var nextDiff=(diff+parseInt(1))%srcArray.length var nowWeek=srcArray[diff] var nextWeek=srcArray[nextDiff] alert("本周值班:"+nowWeek+";下周值班:"+nextWeek) </script>