year(year,month) { // 判断当前年的当前月有多少天
let monthDayTotal = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] //默认闰年
let nowMonthIdx = month - 1 //当前月的下标
if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) { //闰年
return monthDayTotal[nowMonthIdx] //当前月的天数
} else { //平年
monthDayTotal = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
return monthDayTotal[nowMonthIdx] //当前月的天数
}
},