html⽇期选择器⼩⽇历样式,超漂亮的⽹页⽇期时间选择器JS⽇期输⼊控件
action="">
name="textfield" onFocus="CalendarWebControl.show(this,true,this.value);">
请输⼊⽇期:
onFocus="CalendarWebControl.show(this,false,this.value);">
请输⼊⽇期:
function atCalendarControl(){
var calendar=this;
this.calendarPad=null;
this.prevMonth=null;
this.prevYear=null;
this.calendarClose=null;
this.calendarAbout=null;
this.head=null;
this.body=null;
this.currentDate=[];
网页colspanthis.sltDate;
this.target;
this.source;
this.addCalendarPad=function(){
document.write("
style='position:absolute;top:100;left:0;width:255;height:187;display:none;'>");
document.write("
width=250>
");
document.write("
style='position:absolute;top:2;left:2;width:250;height:187;background-color:#336699;'>
");
document.write("
");
calendar.calendarPad=document.all.divCalendarpad;
}
this.addCalendarBoard=function(){
var BOARD=this;
var
ateElement_x("div");
calendar.calendarPad.insertAdjacentElement("beforeEnd",divBoard);
divBoard.style.cssText="position:absolute;top:0;left:0;width:250;height:187;border:0 outset;background-color:buttonface;";
var
ateElement_x("table");
divBoard.insertAdjacentElement("beforeEnd",tbBoard);
tbBoard.style.cssText="position:absolute;top:2;left:2;width:248;height:10;font-size:9pt;"; llPadding=0;
trRow =
tbBoard.insertRow(0);
calendar.calendarAbout=calendar.insertTbCell(trRow,0,"-","center");
calendar.calendarAbout.title="帮助 快捷键:H";
calendar.calendarAbout.οnclick=function(){calendar.about();}
tbCell=trRow.insertCell(1);
tbCell.bgColor="#99CCFF";
tbCell.align="center";
tbCell.style.cssText =
"cursor:default";
calendar.head=tbCell;
tbCell=trRow.insertCell(2);
calendar.calendarClose =
calendar.insertTbCell(trRow,2,"x","center");
calendar.calendarClose.title="关闭 快捷键:ESC或X";
calendar.calendarClose.οnclick=function(){calendar.hide();}
trRow =
tbBoard.insertRow(1);
calendar.prevYear =
calendar.insertTbCell(trRow,0,"<
calendar.prevYear.title="上⼀年
快捷键:↑";
calendar.prevYear.οnmοusedοwn=function(){
calendar.currentDate[0]--;
calendar.show(calendar.urnTime,calendar.currentDate[0]+"-
"+calendar.formatTime(calendar.currentDate[1])+"-"+calendar.formatTime(calendar.currentDate[2]),calendar.source); }
calendar.prevMonth =
calendar.insertTbCell(trRow,1,"
calendar.prevMonth.title="上⼀⽉
快捷键:←";
calendar.prevMonth.οnmοusedοwn=function(){
calendar.currentDate[1]--;
if(calendar.currentDate[1]==0){
calendar.currentDate[1]=12;
calendar.currentDate[0]--;
}
calendar.show(calendar.urnTime,calendar.currentDate[0]+"-
"+calendar.formatTime(calendar.currentDate[1])+"-"+calendar.formatTime(calendar.currentDate[2]),calendar.source); }
calendar.insertTbCell(trRow,2,"今天","center",3);
快捷键:T";
urnTime) calendar.day[0]+"-"+calendar.day[1])+"-
"+calendar.day[2])+"
"+calendar.day[3])+":"+calendar.day[4])
else
calendar.day[0]+"-"+calendar.day[1])+"-
"+calendar.day[2]);
calendar.target.value=calendar.sltDate;
calendar.hide();
//calendar.show(calendar.day[0]+"-"+day[1]+"-"+day[2],calendar.source);
}
calendar.insertTbCell(trRow,3,">","center");
快捷键:→";
calendar.currentDate[1]++;
if(calendar.currentDate[1]==13){
calendar.currentDate[1]=1;
calendar.currentDate[0]++;
}
calendar.show(calendar.urnTime,calendar.currentDate[0]+"-
"+calendar.formatTime(calendar.currentDate[1])+"-"+calendar.formatTime(calendar.currentDate[2]),calendar.source); }
calendar.insertTbCell(trRow,4,">>","center");
快捷键:↓";
calendar.currentDate[0]++;
calendar.show(calendar.urnTime,calendar.currentDate[0]+"-
"+calendar.formatTime(calendar.currentDate[1])+"-"+calendar.formatTime(calendar.currentDate[2]),calendar.source); }
trRow =
tbBoard.insertRow(2);
var cnDateName = new
Array("⽇","⼀","⼆","三","四","五","六");
for (var i = 0; i
< 7; i++) {
tbCell=trRow.insertCell(i)
tbCell.innerText=cnDateName[i];
tbCell.align="center";
tbCell.width=35;
tbCell.style.cssText="cursor:default;border:1 solid
#99CCCC;background-color:#99CCCC;";
}
trRow =
tbBoard.insertRow(3);
tbCell=trRow.insertCell(0);
tbCell.height=97;
tbCell.vAlign="top";
tbCell.bgColor="#F0F0F0";
var
ateElement_x("table");
tbCell.insertAdjacentElement("beforeEnd",tbBody);
tbBody.style.cssText="position:relative;top:0;left:0;width:245;height:103;font-size:9pt;"
calendar.body=tbBody;
trRow =
tbBoard.insertRow(4);
tbCell=trRow.insertCell(0);
calendar.prevHours =
calendar.insertTbCell(trRow,0,"-","center");
calendar.prevHours.title="⼩时调整
快捷键:Home";
calendar.prevHours.οnmοusedοwn=function(){
calendar.currentDate[3]--;
if(calendar.currentDate[3]==-1)
calendar.currentDate[3]=23;
calendar.bottom.innerText=calendar.formatTime(calendar.currentDate[3])+":"+calendar.formatTime(calendar.currentDate[4]);
}
tbCell=trRow.insertCell(1);
calendar.insertTbCell(trRow,1,"+","center");
快捷键:End";

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。