fix long month names to abbreviations

This commit is contained in:
2022-08-12 15:40:00 -05:00
parent c79aff9b4f
commit d07dd3208d

View File

@@ -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)