getDaysInMonth static method

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

Get the number of days in a month

year - The year month - The month (1-12) Returns number of days in the month

Implementation

static int getDaysInMonth(int year, int month) {
  return DateTime(year, month + 1, 0).day;
}