const getDaysInMonth = (year, month) => {
let date = new Date(year, month, 1);
return new Date(date.getTime() - 864e5).getDate();
}
getDaysInMonth(2018,02)
// 28
转载于:https://www.cnblogs.com/lfqcode/p/9660830.html
const getDaysInMonth = (year, month) => {
let date = new Date(year, month, 1);
return new Date(date.getTime() - 864e5).getDate();
}
getDaysInMonth(2018,02)
// 28
转载于:https://www.cnblogs.com/lfqcode/p/9660830.html