daysInMonth static method
Computes the number of days in the given month taking leap years into account.
Dates.daysInMonth(2019, 2); // 28
Dates.daysInMonth(2020, 2); // 29
Implementation
@useResult static int daysInMonth(int year, int month) => (leapYear(year) ? leapYearMonths : nonLeapYearMonths)[month - 1];