summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cleaner.go7
-rw-r--r--config.go2
2 files changed, 9 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()
diff --git a/config.go b/config.go
index d0392d9..910d523 100644
--- a/config.go
+++ b/config.go
@@ -38,6 +38,8 @@ func (cfg *Config) getInterval() (interval time.Duration, err error) {
interval = time.Minute * 5
case "10min":
interval = time.Minute * 10
+ case "30min":
+ interval = time.Minute * 30
case "hour":
interval = time.Hour
case "day":