ratp: Display leading 0 on minutes
This commit is contained in:
parent
905a4d8c97
commit
3cd297c639
@ -12,6 +12,9 @@ from PIL import Image, ImageDraw, ImageFont
|
|||||||
|
|
||||||
def whenStr(date, now):
|
def whenStr(date, now):
|
||||||
if date < now + timedelta(days=1):
|
if date < now + timedelta(days=1):
|
||||||
|
if date.minute <= 9:
|
||||||
|
return f"{date.hour}h0{date.minute}"
|
||||||
|
else:
|
||||||
return f"{date.hour}h{date.minute}"
|
return f"{date.hour}h{date.minute}"
|
||||||
elif date < now + timedelta(days=7):
|
elif date < now + timedelta(days=7):
|
||||||
weekday = date.weekday()
|
weekday = date.weekday()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user