nextMonth static method

DateTime nextMonth(
  1. DateTime m
)

Implementation

static DateTime nextMonth(DateTime m) {
  var year = m.year;
  var month = m.month;

  if (month == 12) {
    year++;
    month = 1;
  } else {
    month++;
  }
  return DateTime(year, month);
}