From c517d735c71eaa9c6bf65b5e1a0f08ee6af2a197 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Kucharczyk?= Date: Mon, 14 Oct 2024 14:26:48 +0200 Subject: [PATCH] use unified dateformat more --- games/views/general.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/games/views/general.py b/games/views/general.py index c217087..5de7bf2 100644 --- a/games/views/general.py +++ b/games/views/general.py @@ -8,7 +8,7 @@ from django.http import HttpRequest, HttpResponse, HttpResponseRedirect from django.shortcuts import redirect, render from django.urls import reverse -from common.time import format_duration +from common.time import dateformat, format_duration from common.utils import safe_division from games.models import Edition, Game, Platform, Purchase, Session @@ -173,10 +173,10 @@ def stats_alltime(request: HttpRequest) -> HttpResponse: if this_year_sessions: first_session = this_year_sessions.earliest() first_play_game = first_session.purchase.edition.game - first_play_date = first_session.timestamp_start.strftime("%x") + first_play_date = first_session.timestamp_start.strftime(dateformat) last_session = this_year_sessions.latest() last_play_game = last_session.purchase.edition.game - last_play_date = last_session.timestamp_start.strftime("%x") + last_play_date = last_session.timestamp_start.strftime(dateformat) all_purchased_this_year_count = this_year_purchases_with_currency.count() all_purchased_refunded_this_year_count: int = this_year_purchases_refunded.count() @@ -400,10 +400,10 @@ def stats(request: HttpRequest, year: int = 0) -> HttpResponse: if this_year_sessions: first_session = this_year_sessions.earliest() first_play_game = first_session.purchase.edition.game - first_play_date = first_session.timestamp_start.strftime("%x") + first_play_date = first_session.timestamp_start.strftime(dateformat) last_session = this_year_sessions.latest() last_play_game = last_session.purchase.edition.game - last_play_date = last_session.timestamp_start.strftime("%x") + last_play_date = last_session.timestamp_start.strftime(dateformat) all_purchased_this_year_count = this_year_purchases_with_currency.count() all_purchased_refunded_this_year_count = this_year_purchases_refunded.count()