From 7af6f05f39683a256b4723e4db2f6574673e401c Mon Sep 17 00:00:00 2001 From: recanman <29310982+recanman@users.noreply.github.com> Date: Thu, 20 Mar 2025 22:15:31 -0700 Subject: [PATCH] fix: replace all dates when creating new issue --- new_issue.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/new_issue.py b/new_issue.py index cd30470..49e2fb0 100755 --- a/new_issue.py +++ b/new_issue.py @@ -71,10 +71,18 @@ def create_issue( lines = content.split("\n") period_string = get_period_string(period_start, period_end, True) + meeting_placeholder = f"{period_start.strftime("%B")} [day], {period_start.year}" + data_placeholder = period_end.strftime("%B %-d, %Y") for i, line in enumerate(lines): if line.startswith("title:"): lines[i] = f'title: "Issue {issue_number}: {period_string}"' + elif line.startswith("{{% event"): # replace date in event shortcode + lines[i] = line.replace("July 1, 2024", meeting_placeholder) + elif 'date="January 1, 2024"' in line: #replace date in bc_stats shortcode + lines[i] = line.replace("January 1, 2024", data_placeholder) + elif 'date="June 6, 2024"' in line: #replace date in price_performance shortcode + lines[i] = line.replace("June 6, 2024", data_placeholder) content = "\n".join(lines)