previousMonth method

MonthAndYear previousMonth()

Implementation

MonthAndYear previousMonth() {
  if (month == 1) {
    return MonthAndYear(
      month: 12,
      year: year - 1,
    );
  }

  return MonthAndYear(
    month: month - 1,
    year: year,
  );
}