Skip to content

Commit

Permalink
Fix date format to make jekyll happy (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
lwasser authored Jul 28, 2023
1 parent 9b7ba68 commit a5d16af
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/pyosmeta/parse_issues.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,13 @@ def parse_issue_header(
# Date accepted is a manually added value. Fix format separately
# Using dashes because it's jekyll friendly
try:
issue_meta["date_accepted"] = issue_meta["date_accepted"].replace(
"/", "-"
)
the_date = issue_meta["date_accepted"].replace("/", "-").split("-")
if the_date[0] == "TBD":
continue
else:
issue_meta[
"date_accepted"
] = f"{the_date[2]}-{the_date[1]}-{the_date[0]}"
except KeyError as ke:
print("Oops,", package_name, "is missing date_accepted key.")
# Clean markdown url's from editor, and reviewer lines
Expand Down Expand Up @@ -347,7 +351,7 @@ def _clean_date(self, date: str) -> str:
date_clean = (
datetime.strptime(date, "%Y-%m-%dT%H:%M:%SZ")
.date()
.strftime("%m-%d-%Y")
.strftime("%Y-%m-%d")
)
except:
print("Oops - i need a string to process date")
Expand Down

0 comments on commit a5d16af

Please sign in to comment.