获取上个月最后一天,只需要设置SetDate参数为0
var endDate = new Date();
//上个月最后一天
endDate.setDate(0)
let limitdate = new Date()
limitdate.setMonth(limitdate.getMonth()+6);
let lastDay = limitdate.setDate(0);//往后5个月的最后一天 取下个月的第一天 然后减去一天
往后5个月的最后一天
获取上个月最后一天,只需要设置SetDate参数为0
var endDate = new Date();
//上个月最后一天
endDate.setDate(0)
let limitdate = new Date()
limitdate.setMonth(limitdate.getMonth()+6);
let lastDay = limitdate.setDate(0);//往后5个月的最后一天 取下个月的第一天 然后减去一天
往后5个月的最后一天