写在前:开发过程中使用年月日,自定义日期获取当前月份天数;
let data= new Date();
const year = date.getFullYear();
const month = date.getMonth() + 1;
//------------------
getDay:function(year,month) {
month = parseInt(month, 10);
var temp = new Date(year, month, 0);
return temp.getDate();
}