时间: 2021-07-31 作者:daque
//************* 插入日子单位格 **************/ this.insertbodycell=function(therow,j,day,targetobject){ var thecell=therow.insertcell(j); if(j==0) var thebgcolor="#ff9999"; else var thebgcolor="#ffffff"; if(day==calendar.currentdate[2]) var thebgcolor="#cccccc"; if(day==calendar.today[2]) var thebgcolor="#99ffcc"; thecell.bgcolor=thebgcolor; thecell.innertext=day; thecell.align="center"; thecell.width=35; thecell.style.csstext="border:1 solid #cccccc;cursor:hand;"; thecell.onmouseover=function(){ thecell.bgcolor="#ffffcc"; thecell.style.csstext="border:1 outset;cursor:hand;"; } thecell.onmouseout=function(){ thecell.bgcolor=thebgcolor; thecell.style.csstext="border:1 solid #cccccc;cursor:hand;"; } thecell.onmousedown=function(){ thecell.bgcolor="#ffffcc"; thecell.style.csstext="border:1 inset;cursor:hand;"; } thecell.onclick=function(){ if(calendar.currentdate[1].length<2) calendar.currentdate[1]="0"+calendar.currentdate[1]; if(day.tostring().length<2) day="0"+day; calendar.sltdate=calendar.currentdate[0]+"-"+calendar.currentdate[1]+"-"+day; calendar.target.value=calendar.sltdate; calendar.hide(); } } /************** 博得月份的第一天为礼拜几 *********************/ this.getfirstday=function(theyear, themonth){ var firstdate = new date(theyear,themonth-1,1); return firstdate.getday(); } /************** 博得月份公有几天 *********************/