js 闰年的算法

var isLeapYear=function(str){
if(str.isInt()){ //isInt()为自定义String扩展方法;
var curYear=parseInt(str, 10);
if(curYear % 400 == 0 || (curYear % 100 !=0 && curYear % 4 == 0)) return true;
else return false;
}
else return false;
}

你可能感兴趣的:(技术)