diff --git a/instagen/utils/gen_image.py b/instagen/utils/gen_image.py index dfa2f40..6ac699b 100644 --- a/instagen/utils/gen_image.py +++ b/instagen/utils/gen_image.py @@ -133,7 +133,10 @@ def gen_image( # First line: Date 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 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 - 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 font = ImageFont.truetype(font_condensed_path, 34) loc = (1050, 355)