fix "," in reminder

This commit is contained in:
Mylloon 2021-08-17 11:15:21 +02:00
parent a4f19733b4
commit 1da3aac896

View file

@ -71,20 +71,17 @@ def timedeltaToString(time):
day -= year * 365 # suppression des années dans le nombre de jour
week = day // 7 # ajout du nombres de semaines
day -= week * 7 # suppression des semaines dans le nombre du jour
yearINT = year # besoin pour le message age[0] final
year = f"{year} an{'s' if year > 1 else ''}" if year > 0 else ""
weekINT = week # besoin pour le message age[0] final
week = f"{week} semaine{'s' if week > 1 else ''}" if week > 0 else ""
day = f"{day} jour{'s' if day > 1 else ''}" if day > 0 else ""
age[0] = f"{year}{', ' if yearINT > 0 else ''}{week}{', ' if weekINT > 0 else ''}{day}"
_ageTemp = [year, week, day]
age[0] = ', '.join(list(set(_ageTemp) - {""})).strip(' ')
else:
age[0] = ""
age[1] = f"{age[1]}h" if affichage[1] == 1 else ''
age[2] = f"{age[2]}m" if affichage[2] == 1 else ''
age[3] = f"{age[3]}s" if affichage[3] == 1 else ''
while "" in age:
age.remove("")
return ', '.join(age).strip(' ')
age[1] = f"{age[1]}h" if affichage[1] == 1 else ""
age[2] = f"{age[2]}m" if affichage[2] == 1 else ""
age[3] = f"{age[3]}s" if affichage[3] == 1 else ""
return ', '.join(list(set(age) - {""})).strip(' ')
def getAge(date):
"""Décompose la différence entre une date et maintenant avec les bons timezone"""