Added limit for time of day table.

This commit is contained in:
Marvin Blum
2020-09-24 21:39:11 +02:00
committed by Marvin Blum
parent b6eb05e90c
commit 8a2fe64dc5

View File

@@ -158,6 +158,12 @@ func GetPlatform(startDate, endDate time.Time) *pirsch.VisitorStats {
}
func GetVisitorTimeOfDay(startDate, endDate time.Time) []pirsch.TimeOfDayVisitors {
max := startDate.Add(time.Hour * 24 * 7)
if endDate.After(max) {
endDate = max
}
visitors, err := analyzer.TimeOfDay(&pirsch.Filter{From: startDate, To: endDate})
if err != nil {