new_issue: adjust get_period_string so leading zeroes are omitted for dates

This commit is contained in:
rottenwheel 2024-08-09 18:53:28 +00:00 committed by GitHub
parent a9925aca61
commit 541b9f7a83
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -26,11 +26,11 @@ def get_period_string(
if period_start.year == period_end.year:
if period_start.month == period_end.month:
period_string = (
f"{period_start.strftime('%B %d')} - {period_end.strftime('%d')}"
f"{period_start.strftime('%B %-d')} - {period_end.strftime('%-d')}"
)
else:
period_string = (
f"{period_start.strftime('%B %d')} - {period_end.strftime('%B %d')}"
f"{period_start.strftime('%B %-d')} - {period_end.strftime('%B %-d')}"
)
if year:
@ -38,7 +38,7 @@ def get_period_string(
else:
period_string = (
f"{period_start.strftime('%B %d, %Y')} - {period_end.strftime('%B %d, %Y')}"
f"{period_start.strftime('%B %-d, %Y')} - {period_end.strftime('%B %-d, %Y')}"
)
return period_string