时间控件9

function CalendarRestore() /// Clear Data
{
var i,j,oTable
oTable=$(this.sTABLEID)
for(i=1;i<oTable.rows.length;i++)
{
for(j=0;j<oTable.rows[i].cells.length;j++)
{
CalendarCellSetCss(0,oTable.rows[i].cells[j]);
oTable.rows[i].cells[j].innerHTML=" ";
}
}
}
function CalendarRefresh(newDate) ///
{
this.currDate=newDate; //alert(newDate);
this.Restore();
this.Fill();
}
function CalendarCellsMsOver(e,oInstance) /// Cell MouseOver
{
var myCell = eventMatchObj(e); //event.srcElement;
CalendarCellSetCss(0,oInstance.oPreviousCell);
if(myCell)
{
CalendarCellSetCss(1,myCell);
oInstance.oPreviousCell=myCell;
}
}
function CalendarCellsMsOut(e,oInstance) // Cell MouseOut
{
var myCell = eventMatchObj(e);
CalendarCellSetCss(0,myCell);
}
function CalendarYearChange(oInstance) /// Year Change
{
var sDay,sMonth,sYear,newDate
sDay=oInstance.currDate.getDate();
sMonth=oInstance.currDate.getMonth();
sYear=$(oInstance.sYEARID).value
newDate=new Date(sYear,sMonth,sDay);
oInstance.Refresh(newDate);
}
function CalendarMonthChange(oInstance) /// Month Change
{
var sDay,sMonth,sYear,newDate
sDay=oInstance.currDate.getDate();
sMonth=$(oInstance.sMONTHID).value
sYear=oInstance.currDate.getFullYear();
newDate=new Date(sYear,sMonth,sDay);
oInstance.Refresh(newDate);
}
function checkTime(sHour,sMinute,sSecond,oInstance){ //参数是input里填的时间
var oldTime=new Array(oInstance.currDate.getHours(),oInstance.currDate.getMinutes(),oInstance.currDate.getSeconds()); //初始化时的时间
var r,re;
re=/\d/i;
r=sHour.match(re);
if(r!=null && sHour>=0 && sHour<24 && sHour!="") oldTime[0]=sHour;
else document.getElementById(oInstance.sHOURID).value=oldTime[0];
r=sMinute.match(re);
if(r!=null && sMinute>=0 && sMinute<59 && sMinute!="" ) oldTime[1]=sMinute;
else document.getElementById(oInstance.sMINUTEID).value=oldTime[1];
r=sSecond.match(re);
if(r!=null && sSecond>=0 && sSecond<59 && sSecond!="" ) oldTime[2]=sSecond;
else document.getElementById(oInstance.sSECONDID).value=oldTime[2];
return oldTime;
}//+stz
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值