8 lines
240 B
Dart
8 lines
240 B
Dart
/// Extension to get last day of the month
|
|
extension LastDay on DateTime {
|
|
/// Returns the last day of the month as [int]
|
|
int get lastDay {
|
|
final d = add(const Duration(days: 31));
|
|
return DateTime(d.year, d.month, 0).day;
|
|
}
|
|
}
|