jsp 日历的源码(3)
var now = new Date ();
monthNow = now.getMonth () + 1;
yearNow = now.getYear ();
dayNow = now.getDate();
yearNow = ( yearNow < 100 ) ? yearNow + 1900 : yearNow;
var count = 0
for (var i = yearNow-103; i < yearNow + 50; i++) {
eval("form.yearList.options[count] = new Option('"+i+"', '"+i+"')");
count++;
}
form.yearList.selectedIndex = 103;
form.yearList.length = count;
}
function error () {
alert ( "超出范围!" );
}
function display_month ( form ) {
var month = form.monthList.selectedIndex + 1;
var year = parseInt ( form.yearList.options[ form.yearList.selectedIndex].text );
var start_day = start_day_in_month ( year, month );
var count = 0;
for ( var row=0; row<6; row++) {
for ( var col=0; col<7; col++ )
{
if ( row == 0 && col < ( start_day - 1 ) )
var day = "";
else if ( count < endDay[month] )
day = ++count;
else
day = "";
form.dayBox[(row*7)+col].style.display = "";
form.dayBox[(row*7)+col].style.color = "black";
相关新闻>>
- 发表评论
-
- 最新评论 更多>>