0
回答
这个在mootools框架下运行出错,请问怎么改...
利用AWS快速构建适用于生产的无服务器应用程序,免费试用12个月>>>   
 document.addEvent('domready', function () {
theWeekTime=function(sb){
var otoday=new Date();
var saturDay=new Date(otoday.getTime()-(otoday.getDay()+1)*86400000);
var sunDay=new Date(otoday.getTime()-otoday.getDay()*86400000);
var monDay=new Date(otoday.getTime()-(otoday.getDay()-1)*86400000);
var tuesDay=new Date(otoday.getTime()-(otoday.getDay()-2)*86400000);
var wednesDay=new Date(otoday.getTime()-(otoday.getDay()-3)*86400000);
var thursDay=new Date(otoday.getTime()-(otoday.getDay()-4)*86400000);
var friDay=new Date(otoday.getTime()+(5-otoday.getDay())*86400000);
var y=new Array();
y[0]=sunDay.getFullYear();
y[1]=monDay.getFullYear();
y[2]=tuesDay.getFullYear();
y[3]=wednesDay.getFullYear();
y[4]=thursDay.getFullYear();
y[5]=friDay.getFullYear();
y[6]=saturDay.getFullYear();
var x=new Array();
x[0]=sunDay.getMonth();
x[1]=monDay.getMonth();
x[2]=tuesDay.getMonth();
x[3]=wednesDay.getMonth();
x[4]=thursDay.getMonth();
x[5]=friDay.getMonth();
x[6]=saturDay.getMonth();
var d=new Array();
d[0]=sunDay.getDate();
d[1]=monDay.getDate();
d[2]=tuesDay.getDate();
d[3]=wednesDay.getDate();
d[4]=thursDay.getDate();
d[5]=friDay.getDate();
d[6]=saturDay.getDate();
$('osaturday').value=(y[6]+"-"+x[6]+"-"+d[6]).toString();
$('osunday').value=(y[0]+"-"+x[0]+"-"+d[0]).toString();
$('omonday').value=(y[1]+"-"+x[1]+"-"+d[1]).toString();
$('otuesday').value=(y[2]+"-"+x[2]+"-"+d[2]).toString();
$('owednesday').value=(y[3]+"-"+x[3]+"-"+d[3]).toString();
$('othursday').value=(y[4]+"-"+x[4]+"-"+d[4]).toString();
$('ofriday').value=(y[5]+"-"+x[5]+"-"+d[5]).toString();
$('startsaturday').value=(y[6]+"-"+x[6]+"-"+d[6]).toString();
$('endfriday').value=(y[5]+"-"+x[5]+"-"+d[5]).toString();
};
theWeekTime.delay(2000);
}); 
举报
司徒
发帖于5年前 0回/205阅

以下是问题补充:

  • @司徒 :是用js实现自动计算每周对应的日期 然后输出 (5年前)
顶部