From 2ce4dd3a0e71e02d700e787184dea0a8cc2afc77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Kucharczyk?= Date: Mon, 16 Jan 2023 17:26:10 +0100 Subject: [PATCH] Fix graph timeline being backwards --- CHANGELOG.md | 3 ++- src/web/tracker/views.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 62dbb94..20f94b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,8 @@ ## Unreleased * Fixed - * When filtering by game, the "Filtering by (...)" text would erroneously list an unrelated platform + * When filtering by game, the "Filtering by (...)" text would erroneously list an unrelated platform + * Playtime graph would display timeline backwards ## 0.2.3 / 2023-01-15 23:13+01:00 diff --git a/src/web/tracker/views.py b/src/web/tracker/views.py index ddf85f1..ca4d85a 100644 --- a/src/web/tracker/views.py +++ b/src/web/tracker/views.py @@ -74,7 +74,8 @@ def list_sessions(request, filter="", purchase_id="", platform_id="", game_id="" context["total_duration"] = dataset.total_duration() context["dataset"] = dataset - context["chart"] = playtime_over_time_chart(dataset) + # charts are always oldest->newest + context["chart"] = playtime_over_time_chart(dataset.order_by("timestamp_start")) return render(request, "list_sessions.html", context)