Files
como-gasto/lib/utils.dart
T
2019-06-07 21:34:27 -03:00

9 lines
207 B
Dart

int daysInMonth(int month) {
var now = DateTime.now();
var lastDayDateTime = (month < 12) ?
new DateTime(now.year, month + 1, 0) : new DateTime(now.year + 1, 1, 0);
return lastDayDateTime.day;
}