getDaysCountInMonth static method
Returns the number of days in the specified month and year.
Implementation
static int getDaysCountInMonth(int year, int month) {
List<int> daysInMonth = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
if (month == 2 && isLeapYear(year)) {
return 29;
}
return daysInMonth[month - 1];
}