Skip to content

Commit

Permalink
feat: set default locale, replace pad 0 in date format
Browse files Browse the repository at this point in the history
  • Loading branch information
SidestreamStrongStrawberry committed Sep 6, 2024
1 parent 4095b83 commit 9040c8d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions scripts/hash-exec-copy.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@
from datetime import datetime
import requests
import subprocess
import locale

INPUT_DATE_FORMAT="%Y-%m-%d"
REPO_URL = "/makerdao/community"

# Set locale to en_US.UTF-8 to ensure consistent formatting
locale.setlocale(locale.LC_ALL, "en_US.UTF-8")

def get_executive_by_title (exec_title):
base_git_api_url = f"https://api.github.com/repos{REPO_URL}/commits"

Expand Down Expand Up @@ -69,8 +73,9 @@ def main():
POSSIBLE_EXEC_TITLES = [
f"Executive%20vote%20-%20{date.strftime('%B %d, %Y')}.md",
f"Executive%20Vote%20-%20{date.strftime('%B %d, %Y')}.md",
f"Executive%20vote%20-%20{date.strftime('%B %-d, %Y')}.md",
f"Executive%20Vote%20-%20{date.strftime('%B %-d, %Y')}.md"
# Remove leading 0 in day
f"Executive%20vote%20-%20{date.strftime('%B %d, %Y').replace(' 0', ' ')}.md",
f"Executive%20Vote%20-%20{date.strftime('%B %d, %Y').replace(' 0', ' ')}.md"
]
executive_content, executive_url, commit_hash = None, None, None
for exec_title in POSSIBLE_EXEC_TITLES:
Expand Down

0 comments on commit 9040c8d

Please sign in to comment.