changeset 3372:ea49febfbc60

Calculate quarters correctly in waterlevel classification.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Wed, 22 May 2019 13:04:00 +0200
parents f76a694f7f7b
children 27aca46771b5
files pkg/controllers/bottlenecks.go
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/pkg/controllers/bottlenecks.go	Wed May 22 12:53:18 2019 +0200
+++ b/pkg/controllers/bottlenecks.go	Wed May 22 13:04:00 2019 +0200
@@ -687,7 +687,7 @@
 		}
 		f := pfrom
 		pfrom = pfrom.AddDate(0, 3, 0)
-		label := fmt.Sprintf("Q%d-%d", int(f.Month())/4+1, f.Year())
+		label := fmt.Sprintf("Q%d-%d", 1+int(f.Month()+1)/4, f.Year())
 		return f, f.AddDate(0, 3, 0).Add(-time.Nanosecond), label
 	}
 }