From 0caa78b074946db364e43bb9c61deb376b21ba47 Mon Sep 17 00:00:00 2001 From: Ming Ming Date: Mon, 15 Jul 2024 01:24:25 +0800 Subject: [PATCH] Refactor: move unrelated fns out of class definition --- np_datetime/lib/src/date.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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,