From f130e9a71ea3437912b9be6dc82304e2b5c9b3f1 Mon Sep 17 00:00:00 2001 From: Razmig Sarkissian Date: Fri, 28 Apr 2023 23:43:31 +0200 Subject: [PATCH] format duration --- scores/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scores/models.py b/scores/models.py index 1a3ded9..a49c29b 100644 --- a/scores/models.py +++ b/scores/models.py @@ -57,12 +57,12 @@ class Match(models.Model): if _seconds > 0: _hours = int(_seconds / 3600) _minutes = int((_seconds % 3600) / 60) - return f"{_hours:02d}:{_minutes:02d} min" + return f"{_hours:02d}h{_minutes:02d}min" else : _seconds = _seconds * -1 _hours = int(_seconds / 3600) _minutes = int((_seconds % 3600) / 60) - return f"{_hours:02d}:{_minutes:02d} min" + return f"{_hours:02d}h{_minutes:02d}min" def seconds(self): return (timezone.now() - self.date).total_seconds()