summaryrefslogtreecommitdiff
path: root/cleaner.go
diff options
context:
space:
mode:
authorDaniel Langesten <daniel.langest@gmail.com>2015-03-19 09:56:10 +0100
committerDaniel Langesten <daniel.langest@gmail.com>2015-03-19 09:56:10 +0100
commit549b19ac283900fdc3f9721d8570876200b3ab38 (patch)
treefcf3c38d829be0d219cab59c0c9e91fea3fd6b3d /cleaner.go
parent7c132313f5ac026bb8af1f5e3da07564d144ba17 (diff)
added an interval of 30 min
Diffstat (limited to 'cleaner.go')
-rw-r--r--cleaner.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/cleaner.go b/cleaner.go
index 7601766..0e213c9 100644
--- a/cleaner.go
+++ b/cleaner.go
@@ -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()