mirror of
https://github.com/rottenwheel/revuo-weekly.git
synced 2025-03-31 21:51:22 -06:00
Merge pull request #72 from recanman/master
fix: replace all dates when creating new issue
This commit is contained in:
commit
7ac3c3aad3
@ -71,10 +71,18 @@ def create_issue(
|
|||||||
lines = content.split("\n")
|
lines = content.split("\n")
|
||||||
|
|
||||||
period_string = get_period_string(period_start, period_end, True)
|
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):
|
for i, line in enumerate(lines):
|
||||||
if line.startswith("title:"):
|
if line.startswith("title:"):
|
||||||
lines[i] = f'title: "Issue {issue_number}: {period_string}"'
|
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)
|
content = "\n".join(lines)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user