闰年、平年

 

 

平年有28天,闰年有29天

if(( year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {
// 闰年 29 天
showDays((days[index]+1));
} else {
// 平年 28 天
showDays(days[index]);
}

 

posted @ 2017-11-22 15:05  前端开发小姐姐  阅读(172)  评论(0)    收藏  举报