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