Show hourly chart starting from ranges of 3 days and less

This commit is contained in:
CasperVerswijvelt 2021-04-27 21:58:07 +02:00
parent 2221a99662
commit c2daf3a5a5

View File

@ -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"]