daysInMonth property

int daysInMonth

Returns the amount of days that are in this month.

Accounts for leap years.

Implementation

int get daysInMonth {
  final days = [
    31, // January
    if (isLeapYear) 29 else 28, // February
    31, // March
    30, // April
    31, // May
    30, // June
    31, // July
    31, // August
    30, // September
    31, // October
    30, // November
    31, // December
  ];

  return days[month - 1];
}