Always cast post datetimes to dates on render

This commit is contained in:
Fabio Manganiello 2024-04-11 01:10:25 +02:00
parent d517416077
commit 817b23ac69

View file

@ -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)
)
).date()
else:
metadata[m.group(1)] = m.group(2)