From 75fb5ec33cc204dc466033ff85720b75125075e2 Mon Sep 17 00:00:00 2001 From: Edward Viaene Date: Fri, 6 Sep 2024 22:02:24 -0500 Subject: [PATCH] date utils --- pkg/utils/date/compare.go | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 pkg/utils/date/compare.go diff --git a/pkg/utils/date/compare.go b/pkg/utils/date/compare.go new file mode 100644 index 0000000..b6a901e --- /dev/null +++ b/pkg/utils/date/compare.go @@ -0,0 +1,9 @@ +package dateutils + +import "time" + +func DateEqual(date1, date2 time.Time) bool { + y1, m1, d1 := date1.Date() + y2, m2, d2 := date2.Date() + return y1 == y2 && m1 == m2 && d1 == d2 +}