From 3f7dabb2d5f98ca918a35bccaa3d3c49c58ba0f9 Mon Sep 17 00:00:00 2001 From: Marvin Blum Date: Thu, 24 Sep 2020 21:57:07 +0200 Subject: [PATCH] Swapped start and end date for time of day. --- tracking/statistics.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tracking/statistics.go b/tracking/statistics.go index 2300486..64115c8 100644 --- a/tracking/statistics.go +++ b/tracking/statistics.go @@ -158,10 +158,10 @@ func GetPlatform(startDate, endDate time.Time) *pirsch.VisitorStats { } func GetVisitorTimeOfDay(startDate, endDate time.Time) []pirsch.TimeOfDayVisitors { - max := startDate.Add(time.Hour * 24 * 7) + min := endDate.Add(-time.Hour * 24 * 7) - if endDate.After(max) { - endDate = max + if startDate.Before(min) { + startDate = min } visitors, err := analyzer.TimeOfDay(&pirsch.Filter{From: startDate, To: endDate})