daysInMonth static method

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

Returns the number of days in month of year.

Implementation

static int daysInMonth(int year, int month) {
  if (month == DateTime.december) {
    return DateTime(year + 1, DateTime.january, 0).day;
  }
  return DateTime(year, month + 1, 0).day;
}