mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-02-02 06:46:22 +01:00
Refactor: move unrelated fns out of class definition
This commit is contained in:
parent
f43910f68b
commit
0caa78b074
1 changed files with 3 additions and 3 deletions
|
@ -24,9 +24,6 @@ class Date implements Comparable<Date> {
|
|||
return Date(year ?? this.year, month ?? this.month, day ?? this.day);
|
||||
}
|
||||
|
||||
DateTime toUtcDateTime() => DateTime.utc(year, month, day);
|
||||
DateTime toLocalDateTime() => DateTime(year, month, day);
|
||||
|
||||
@override
|
||||
int compareTo(Date other) => toUtcDateTime().compareTo(other.toUtcDateTime());
|
||||
|
||||
|
@ -49,6 +46,9 @@ class Date implements Comparable<Date> {
|
|||
}
|
||||
|
||||
extension DateExtension on Date {
|
||||
DateTime toUtcDateTime() => DateTime.utc(year, month, day);
|
||||
DateTime toLocalDateTime() => DateTime(year, month, day);
|
||||
|
||||
Date add({
|
||||
int? year,
|
||||
int? month,
|
||||
|
|
Loading…
Reference in a new issue