diff --git a/np_datetime/lib/src/date.dart b/np_datetime/lib/src/date.dart index 41ca2fde..c59f7412 100644 --- a/np_datetime/lib/src/date.dart +++ b/np_datetime/lib/src/date.dart @@ -24,9 +24,6 @@ class Date implements Comparable { 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 { } extension DateExtension on Date { + DateTime toUtcDateTime() => DateTime.utc(year, month, day); + DateTime toLocalDateTime() => DateTime(year, month, day); + Date add({ int? year, int? month,