From e67cc0d542cfe6de7cfdb3f34d92b6e1988f5dde Mon Sep 17 00:00:00 2001 From: Mylloon Date: Fri, 30 Jul 2021 12:47:14 +0200 Subject: [PATCH] better comma placement --- src/utils/time.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/utils/time.py b/src/utils/time.py index a293d51..2315dfd 100644 --- a/src/utils/time.py +++ b/src/utils/time.py @@ -56,7 +56,8 @@ def timestampScreen(timestamp): def timedeltaToString(time): """Différence entre une heure en seconde et maintenant""" - age = str(timedelta(seconds = time)).replace('day', 'jour').replace(', ', ', :').split(':') + age = str(timedelta(seconds = time)).replace('day', 'jour').replace(', ', ':').split(':') + print(age) if len(age) == 4: a = [1, 1, 1, 1] # a pour affichage if len(age) == 3: @@ -66,7 +67,7 @@ def timedeltaToString(time): if int(age[i]) == 0: a[i] = 0 age[0] = age[0] if a[0] == 1 else '' - age[1] = f"{age[1]}h " if a[1] == 1 else '' + age[1] = f", {age[1]}h " if a[1] == 1 else '' age[2] = f"{age[2]}m " if a[2] == 1 else '' age[3] = f"{age[3]}s" if a[3] == 1 else '' return ''.join(age).strip(' ')