|
@@ -70,7 +70,7 @@ func AddDate(t time.Time, years, months int) time.Time {
|
|
targetMonth = (targetMonth-1)%12 + 1
|
|
targetMonth = (targetMonth-1)%12 + 1
|
|
|
|
|
|
// 计算目标年份
|
|
// 计算目标年份
|
|
- targetYear := t.Year() + years + (int(month)+months)/12
|
|
|
|
|
|
+ targetYear := t.Year() + years + (int(month)+months-1)/12
|
|
|
|
|
|
// 计算目标月份最大天数
|
|
// 计算目标月份最大天数
|
|
maxDayOfTargetMonth := daysOfMonth[targetMonth-1]
|
|
maxDayOfTargetMonth := daysOfMonth[targetMonth-1]
|