fix long month names to abbreviations
This commit is contained in:
@@ -133,7 +133,10 @@ def gen_image(
|
||||
|
||||
# First line: Date
|
||||
font = ImageFont.truetype(font_regular_path, 62)
|
||||
if len(f"{date:%B}") <= 4:
|
||||
text = f"{date:%a, %B %-d %-I:%M %p}".upper()
|
||||
else:
|
||||
text = f"{date:%a, %b %-d %-I:%M %p}".upper()
|
||||
# text = date
|
||||
loc = (1050, 280)
|
||||
section_info_draw.text(loc, text, (14, 42, 28), font=font, anchor="ra")
|
||||
@@ -267,7 +270,10 @@ def gen_results_image(
|
||||
)
|
||||
|
||||
# Second line: Date
|
||||
if len(f"{date:%B}") <= 4:
|
||||
text = f"{date:%a, %B %-d %-I:%M %p}".upper()
|
||||
else:
|
||||
text = f"{date:%a, %b %-d %-I:%M %p}".upper()
|
||||
# text = date
|
||||
font = ImageFont.truetype(font_condensed_path, 34)
|
||||
loc = (1050, 355)
|
||||
|
||||
Reference in New Issue
Block a user