ratp: Display leading 0 on minutes

This commit is contained in:
nemunaire 2023-09-06 10:34:49 +02:00
parent 905a4d8c97
commit 3cd297c639
1 changed files with 4 additions and 1 deletions

View File

@ -12,7 +12,10 @@ from PIL import Image, ImageDraw, ImageFont
def whenStr(date, now):
if date < now + timedelta(days=1):
return f"{date.hour}h{date.minute}"
if date.minute <= 9:
return f"{date.hour}h0{date.minute}"
else:
return f"{date.hour}h{date.minute}"
elif date < now + timedelta(days=7):
weekday = date.weekday()
if weekday == 0: