From 08ba2e4238fdc518afda1191fb56bc457af3b2b6 Mon Sep 17 00:00:00 2001 From: Daniel Langesten Date: Tue, 10 Mar 2015 11:39:52 +0100 Subject: fixed bug where the intervals were calculated wrong --- cleaner.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cleaner.go b/cleaner.go index 247abef..c59b562 100644 --- a/cleaner.go +++ b/cleaner.go @@ -89,14 +89,14 @@ func getTimespan(t time.Time) (span time.Time, err error) { y, m, d := t.Date() h := t.Hour() min := t.Minute() - min = min / 5 + min = (min / 5) * 5 span = time.Date(y, m, d, h, min, 0, 0, loc) case TIMESPAN == "10min": //Round the date into 10 minutes y, m, d := t.Date() h := t.Hour() min := t.Minute() - min = min / 10 + min = (min / 10) * 10 span = time.Date(y, m, d, h, min, 0, 0, loc) case TIMESPAN == "hour": //Round the date into hour -- cgit v1.1