getNextMonthDate(date){
if(date==null){
date=new Date();
}
// 创建一个Date对象,默认为当前日期和时间
var now = new Date(date);
// 获取当前年份和月份
var currentYear = now.getFullYear();
var currentMonth = now.getMonth();
// 计算下个月的年份和月份
var nextMonth = (currentMonth + 1) % 12; // 月份加1后取模12
console.log(nextMonth);
var nextYear = currentYear;
if (nextMonth === 0) { // 如果月份变成0了,说明是12月的下一个月,即下一年的1月
nextYear++;
}
// 创建一个表示下个月第一天的Date对象
var nextMonthFirstDay = new Date(nextYear, nextMonth, 1);
return nextMonthFirstDay;
},
09-13