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 };
最怕一生碌碌无为还说平凡难能可贵。
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 };