//日期 function getWeek(dateString) { var day = new Date(Date.parse(dateString)); var today = new Array('星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'); var week = today[day.getDay()]; return week; }; function indexDateF(){ $('.contest_list .datedd').remove(); function tDou(n){ return n>9? n: "0"+n; } function GetDateStr(AddDayCount) { var dd = new Date(); dd.setDate(dd.getDate()+AddDayCount); var y = dd.getFullYear(); var m = tDou(dd.getMonth()+1); var d = tDou(dd.getDate()); return [y+"-"+m+"-"+d,m,d,y]; } for(i=-1;i<10;i++){ var str=GetDateStr(i)[0]; var m=GetDateStr(i)[1]; var d=GetDateStr(i)[2]; var y=GetDateStr(i)[3]; if($('.contest_list li[data-datetime^='+str+']').length>0){ var oDHtml="

"+y+"-"+m+"-"+d+""+ getWeek(GetDateStr(i)[0]) +"

"; $('.contest_list li[data-datetime^='+str+']').eq(0).before(oDHtml); } } } indexDateF();