js根据年份获取某月份有几天

1 function getNum(year, month) {
2     var temp;
3     month = parseInt(month, 10);
4     temp = new Date(year, month, 0);
5     return temp.getDate();
6 };

 

posted @ 2018-08-03 16:23  .Concise  阅读(791)  评论(0编辑  收藏  举报