// 获取指定月的天数
function getMonthDays(year, month) {
const thisDate = new Date(year, month, 0); //当天数为0 js自动处理为上一月的最后一天
return thisDate.getDate();
}
js获取指定月的天数
最新推荐文章于 2023-01-05 14:30:19 发布
// 获取指定月的天数
function getMonthDays(year, month) {
const thisDate = new Date(year, month, 0); //当天数为0 js自动处理为上一月的最后一天
return thisDate.getDate();
}