From f69b55b1f9434c83b7b7a07e497ad565559ab3cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferdinand=20M=C3=BCtsch?= Date: Thu, 20 Feb 2020 15:54:20 +0100 Subject: [PATCH] Default interval. --- routes/summary.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/routes/summary.go b/routes/summary.go index 80172d0..dca77ff 100644 --- a/routes/summary.go +++ b/routes/summary.go @@ -78,6 +78,12 @@ func (h *SummaryHandler) Index(w http.ResponseWriter, r *http.Request) { h.loadTemplates() } + q := r.URL.Query() + if q.Get("interval") == "" && q.Get("from") == "" { + q.Set("interval", "today") + r.URL.RawQuery = q.Encode() + } + summary, err, status := loadUserSummary(r, h.SummarySrvc) if err != nil { w.WriteHeader(status)