daysInMonth function

int daysInMonth(
  1. int year,
  2. int month
)

Returns the number of days in the specified month.

This function assumes the use of the Gregorian calendar or the proleptic Gregorian calendar.

Implementation

int daysInMonth(int year, int month) =>
    (month == DateTime.february && isLeapYear(year)) ? 29 : _daysInMonth[month];