Always cast post datetimes to dates on render
This commit is contained in:
parent
d517416077
commit
817b23ac69
1 changed files with 3 additions and 6 deletions
|
@ -69,12 +69,9 @@ class BlogApp(Flask):
|
|||
break
|
||||
|
||||
if m.group(1) == "published":
|
||||
try:
|
||||
metadata[m.group(1)] = datetime.date.fromisoformat(m.group(2))
|
||||
except ValueError:
|
||||
metadata[m.group(1)] = datetime.datetime.fromisoformat(
|
||||
m.group(2)
|
||||
)
|
||||
metadata[m.group(1)] = datetime.datetime.fromisoformat(
|
||||
m.group(2)
|
||||
).date()
|
||||
else:
|
||||
metadata[m.group(1)] = m.group(2)
|
||||
|
||||
|
|
Loading…
Reference in a new issue