From c2daf3a5a5e45ff4aa0c48bd6744edaded6d0baf Mon Sep 17 00:00:00 2001 From: CasperVerswijvelt Date: Tue, 27 Apr 2021 21:58:07 +0200 Subject: [PATCH] Show hourly chart starting from ranges of 3 days and less --- shynet/core/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/shynet/core/models.py b/shynet/core/models.py index de15a65..302e6fd 100644 --- a/shynet/core/models.py +++ b/shynet/core/models.py @@ -204,7 +204,8 @@ class Service(models.Model): if session_count == 0: avg_session_duration = None - if end_time.day == start_time.day: + # Show hourly chart for date ranges of 3 days or less, otherwise daily chart + if end_time.day <= start_time.day + 2: session_chart_tooltip_format = "MM/dd HH:mm" session_chart_data = { k["hour"]: k["count"]