test.html
script src=uc.js>
//拿过来就可以用,很简单。
//实例化时第一个参数是input的name;第二个参数是value,设为"today"就是当天。
var date1 = new UncCalendar ("date",
"2008-08-08");
date1.display();
//有一些属性,可以灵活的定制。
//事实上直接到uc.js中修改默认属性值使用起来会更方便一些,里面有注释。
var date2 = new UncCalendar ();
date2.inputName = "date"; //input的name。
date2.inputValue = "today"; //你会看到,input中将显示客户机系统当前时间。
date2.inputSize = 10; //input的size
date2.inputClass = ""; //input的class,这样你就能自己控制input的样式。
date2.color = "#000080"; //选择按钮、面板的边框以及日历中字的颜色。
date2.bgColor = "#EEEEFF"; //选择按钮、面板的背景色。
date2.buttonWidth = 60; //按钮宽度
date2.buttonWords =
"选择日期"; //按钮显示的文字。
date2.canEdits = false; //input是否可以输入
date2.hidesSelects = true; //显增日期选择面板时是否隐藏页面中的select控件。
date2.display();
第二个:
test.html
新增任务工单/head>
size="20" value="2006-04-15 00:00:00" οnfοcus="setday(this)"
readonly="readonly">
下面是 table_calendar.js
function writeCalender(){
document.writeln('
style="position: absolute; width: 142; height: 166; z-index: 9998;
display: none">');
document.writeln('
src="javascript:false" style="position:absolute;
visibility:inherit; top:0px; left:0px; width:142px; height:255px;
z-index:-1;filter=。'progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)。';">
');document.writeln('
id=tmpSelectYearLayer style="z-index:
9999;position: absolute;top: 2; left: 18;display:
none">
');document.writeln('
style="z-index: 9999;position: absolute;top: 2; left: 75;display:
none">
');document.writeln('
cellspacing=1 cellpadding=0 width=142 height=160 bgcolor=#808080
onselectstart="return false">');
document.writeln('
border=0 cellspacing=1 cellpadding=0 width=140
height=23>');
document.writeln('
style="font-size:12px;cursor: hand;color: #FFD700" ');
document.writeln(' οnclick="bltPrevM()" title="向前翻一月" Author=blt>
Author=blt><<');
document.writeln('
style="font-size:12px;cursor:default" Author=blt>');
document.writeln('
οnclick="tmpSelectYearInnerHTML(this.innerText)">
年document.writeln(' id=bltMonthHead Author=blt
οnclick="tmpSelectMonthInnerHTML(this.innerText)">
月');document.writeln('
style="font-size:12px;cursor: hand;color: #FFD700" ');
document.writeln(' οnclick="bltNextM()" title="往后翻一月" Author=blt>
Author=blt>>>
');document.writeln('
');document.writeln('
');document.writeln('
cellspacing=0 cellpadding=0 width=140 height=1
style="cursor:default">');
document.writeln('
style="font-size:12px;color:#FFFFFF"
Author=blt>日
');document.writeln('
style="font-size:12px;color:#FFFFFF"
Author=blt>一
style="font-size:12px;color:#FFFFFF"
Author=blt>二
');document.writeln('
style="font-size:12px;color:#FFFFFF"
Author=blt>三
style="font-size:12px;color:#FFFFFF"
Author=blt>四
');document.writeln('
style="font-size:12px;color:#FFFFFF"
Author=blt>五
style="font-size:12px;color:#FFFFFF"
Author=blt>六
');document.writeln('
');document.writeln('
');document.writeln('
bgcolor=#FFFFFF Author=blt> ');
var n=0; for (j=0;j<6;j++){ document.writeln
('
'); for (i=0;i<7;i++){document.writeln('
id=bltDay'+n+' style="font-size:12px" Author=blt
οnclick=bltDayClick(this.innerText,this)>
');n++;}document.writeln('
');}document.writeln('
');document.writeln('
');document.writeln(' ');
for( j = 0; j < 24; j++ )
{
if( j < 10 )
document.writeln(' ' + j + '');
else
document.writeln(' ' + j + '');
}
document.writeln(' 时
');document.writeln('
');document.writeln(' ');
for( j = 0; j < 60; j++ )
{
if( j < 10 )
document.writeln(' ' + j + '');
else
document.writeln(' ' + j + '');
}
document.writeln(' 分');
document.writeln('
');document.writeln('
');document.writeln('
');document.writeln(' 确 定');
document.writeln('
');document.writeln('
');document.writeln(' 取 消');
document.writeln('
');document.writeln('
');document.writeln('
bgcolor=#FFFFFF>');
document.writeln('
title="向前翻一年" οnclick="bltPrevY()" ');
document.writeln(' οnfοcus="this.blur()"><
title="向前翻一月" ');
document.writeln(' οnclick="bltPrevM()"
οnfοcus="this.blur()"><<
');
document.writeln(' Author=blt align=center>
οnclick="bltToday()" ');
document.writeln(' οnfοcus="this.blur()" title="现在的年月">今
天
document.writeln(' Author=blt align=right>
');
document.writeln(' οnfοcus="this.blur()" title="往后翻一月">>>
document.writeln(' Author=blt title="往后翻一年" οnclick="bltNextY()"');
document.writeln(' οnfοcus="this.blur()"> >
');document.writeln('
}