summaryrefslogtreecommitdiff
path: root/utils.go
diff options
context:
space:
mode:
authorNikolaus Gotsche <n@softwarefools.com>2019-05-22 23:46:20 +0200
committerNikolaus Gotsche <n@softwarefools.com>2019-05-22 23:46:20 +0200
commit06c765d4691dd65b926343e5391f627ac8a9c983 (patch)
tree2cbe1107396eef52ad4d2d6b738dc840538f6476 /utils.go
parent83410ee498d56f18ccab0abb9c69f112f4d9f008 (diff)
interactive analysis
Diffstat (limited to 'utils.go')
-rw-r--r--utils.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/utils.go b/utils.go
index 5b5be5a..3f04959 100644
--- a/utils.go
+++ b/utils.go
@@ -276,6 +276,13 @@ func Round(x, unit float64) float64 {
return RetardRound(x/unit) * unit
}
+// TEst if two time objects happen on same date
+func DateEqual(date1, date2 time.Time) bool {
+ y1, m1, d1 := date1.Date()
+ y2, m2, d2 := date2.Date()
+ return y1 == y2 && m1 == m2 && d1 == d2
+}
+
func cleanString(in string) (out string) {
work := strings.Replace(in, "/", "-", -1)
work = strings.Replace(work, "*", "-", -1)