js日期加一年
var date=new Date('2021-12-7'); date.setFullYear(date.getFullYear()+1); var time = date.toLocaleDateString().split('/').join('-') alert(time); //2022-12-7 date.setDate(date.getDate()+1); var time1 = date.toLocaleDateString().split('/').join('-') alert(time1); //2022-12-6