jsp 日历的源码(5)
n = Math.floor ( ( (n / 7 - Math.floor ( (n / 7) ) ) * 7 + 0.5 ) );
return (n+1);
}
function CheckDate(strDay) {
var docFrm = document.calendar;
var choice_daynum = 0;
var current_daynum = 0;
var day_temp;
if (strDay != "") {
var strY = docFrm.yearList.value;
var strM = docFrm.monthList.value;
var curr_y = new String(yearNow);
var curr_m = new String(monthNow);
var curr_d = new String(dayNow);
if (curr_m.length == 1) curr_m = "0"+curr_m;
if (curr_d.length == 1) curr_d = "0"+curr_d;
current_daynum = new Number(curr_y + curr_m + curr_d) ;
if (strM.length == 1) strM = "0"+strM;
if (strDay.length == 1) strDay = "0"+strDay;
choice_daynum = new Number(strY + strM + strDay);
parent.window.returnValue = strY+"-"+strM+"-"+strDay; //将选择的日期传递到父窗口中
parent.window.close();
}
return false;
}
-->
</script>
<body onLoad="load(document.calendar)" topmargin="0">
<center>
<form name="calendar">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="3" height="24"></td>
</tr>
<tr>
<td width="205" nowrap="nowrap" align="right"><select name="yearList" onChange="display_month(this.form)">
</select>
</td>
<td width="65" nowrap="nowrap" align="left"><select name="monthList" size="1" onChange="display_month(this.form)">
<%for(int i=1;i<13;i++){%>
<option value="<%=i%>"><%=i%></option>
相关新闻>>
- 发表评论
-
- 最新评论 更多>>