addMonths method
Implementation
MonthAndYear addMonths(int months) {
final newYear = year + (month + months - 1) ~/ 12;
final newMonth = (month + months - 1) % 12 + 1;
return MonthAndYear(
month: newMonth,
year: newYear,
);
}
MonthAndYear addMonths(int months) {
final newYear = year + (month + months - 1) ~/ 12;
final newMonth = (month + months - 1) % 12 + 1;
return MonthAndYear(
month: newMonth,
year: newYear,
);
}