HTML组件之:编写日历(2),HTML组件之:编写日历(2)
【 tulaoshi.com - Html 】
===编写日历一===function leapYear(year) {
if (year % 4 == 0) // basic rule
return true; // is leap year
/* else */ // else not needed when statement is "return"
return false; // is not leap year
}
getMonthName()函数返回指定月份的名字:
function getMonthName(month) {
// create array to hold name of each month
var ar = new Array(12);
ar[0] = "January";
ar = "February";
ar = "March";
ar = "April";
ar = "May";
ar = "June";
ar = "July";
ar = "August";
ar = "September";
ar = "October";
ar = "November";
ar = "December";
// return name of specified month (parameter)
return ar[month];
}
来源:http://www.tulaoshi.com/n/20160129/1484763.html
看过《HTML组件之:编写日历(2)》的人还看了以下文章 更多>>