From 78bea501a872de3ad870c24a198ad1d39a0e31af Mon Sep 17 00:00:00 2001 From: CasperVerswijvelt Date: Tue, 27 Apr 2021 23:39:58 +0200 Subject: [PATCH] Use timedelta instead of checking days difference which did not work correctly --- shynet/core/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shynet/core/models.py b/shynet/core/models.py index 302e6fd..7c7d40e 100644 --- a/shynet/core/models.py +++ b/shynet/core/models.py @@ -205,7 +205,7 @@ class Service(models.Model): avg_session_duration = None # Show hourly chart for date ranges of 3 days or less, otherwise daily chart - if end_time.day <= start_time.day + 2: + if (end_time - start_time).days <= 3: session_chart_tooltip_format = "MM/dd HH:mm" session_chart_data = { k["hour"]: k["count"]