也就是说要禁用掉上上个月日期以及之前的,代码如下:
disabledSTDate(time) {
let twoDate = new Date();
twoDate.setMonth(twoDate.getMonth() - 2); // 上上个月日期
let lastMonth = twoDate.getMonth() + 1; // 上上个月
let lastYear = twoDate.getFullYear(); // 上上个月所属年
let lastDate = new Date(lastYear, lastMonth, 0); // 上上个月最后一天
return time.getTime() <= lastDate.getTime()
}