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