当我有一个月的 2 月时,如何让下面的代码工作?目前它正在到达当天,然后在到达 if 之前停止,以确定它是否是闰年。
if (month == 2) {
if (day == 29) {
if (year % 4 != 0 || year % 100 == 0 && year % 400 != 0) {
field.focus();
field.value = month +'/' + '';
}
}
else if (day > 28) {
field.focus();
field.value = month +'/' + '';
}
}