2024-06-30 20:25:36 +02:00
|
|
|
// SPDX-FileCopyrightText: (C) 2024 Matyáš Caras
|
|
|
|
//
|
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
2024-01-08 15:38:31 +01:00
|
|
|
/// 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;
|
|
|
|
}
|
|
|
|
}
|