Swapped start and end date for time of day.

This commit is contained in:
Marvin Blum
2020-09-24 21:57:07 +02:00
committed by Marvin Blum
parent 8a2fe64dc5
commit 3f7dabb2d5

View File

@@ -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})