function addMonth(date, add) { if (date instanceof Date && !isNaN(offset)) { let nowMonth = date.getMonth(); let newMonth = nowMonth + add; date.setMonth(newMonth); return date; } }
链接: https://pan.baidu.com/s/1RUJJreyR75csJfNUfW3aiA 提取码: s7bc 复制这段内容后打开百度网盘手机App,操作更方便哦