diff options
author | Daniel Langesten <daniel.langest@gmail.com> | 2015-03-19 09:56:10 +0100 |
---|---|---|
committer | Daniel Langesten <daniel.langest@gmail.com> | 2015-03-19 09:56:10 +0100 |
commit | 549b19ac283900fdc3f9721d8570876200b3ab38 (patch) | |
tree | fcf3c38d829be0d219cab59c0c9e91fea3fd6b3d /cleaner.go | |
parent | 7c132313f5ac026bb8af1f5e3da07564d144ba17 (diff) |
added an interval of 30 min
Diffstat (limited to 'cleaner.go')
-rw-r--r-- | cleaner.go | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -120,6 +120,13 @@ func getTimespan(t time.Time, cfg *Config) (span time.Time, err error) { min = (min / 10) * 10 span = time.Date(y, m, d, h, min, 0, 0, loc) + case cfg.Interval == "30min": //Round the date into 10 minutes + y, m, d := t.Date() + h := t.Hour() + min := t.Minute() + min = (min / 30) * 30 + span = time.Date(y, m, d, h, min, 0, 0, loc) + case cfg.Interval == "hour": //Round the date into hour y, m, d := t.Date() h := t.Hour() |