var DS_x,DS_y;
function dateSelector() //构造dateSelector对象,用来实现一个日历形式的日期输入框。{ var myDate=new Date(); this.year=myDate.getYear(); //定义year属性,年份,默认值为当前系统年份。 this.month=myDate.getMonth()+1; //定义month属性,月份,默认值为当前系统月份。 this.date=myDate.getDate(); //定义date属性,日,默认值为当前系统的日。 this.inputName=''; //定义inputName属性,即输入框的name,默认值为空。注意:在同一页中出现多个日期输入框,不能有重复的name! this.display=display; //定义display方法,用来显示日期输入框。}
function display() //定义dateSelector的display方法,它将实现一个日历形式的日期选择框。{ var week=new Array('日','一','二','三','四','五','六');
document.write(""); document.write(" .ds_font td,span { font: normal 12px 宋体; color: #000000; }"); document.write(" .ds_border { border: 1px solid #000000; cursor: hand; background-color: #DDDDDD }"); document.write(" .ds_border2 { border: 1px solid #000000; cursor: hand; background-color: #DDDDDD }"); document.write("");
document.write(""); document.write("选择日期");
document.write(""); document.write(" "); document.write("
<< | "); document.write("< | "); document.write(""+this.year+" 年 "+this.month+" 月 | ");
document.write(" > | "); document.write(">> | "); document.write("
document.write("