Skip to content

Commit 8722ce2

Browse files
authored
Merge pull request #289 from ByteInternet/ext_updated_at_parse_zulu_mark
2 parents 61d541b + 2b904d4 commit 8722ce2

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

hypernode/sphinx/extensions/updated_at.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import os.path
2+
import re
23
from datetime import datetime
34
from pathlib import Path
45
from typing import TYPE_CHECKING
@@ -37,11 +38,13 @@ def execute(self, app: "Sphinx", pagename: str, templatename, context, doctree):
3738
)
3839

3940
if created:
41+
created = re.sub(r"Z$", "+00:00", created)
4042
context["created_at"] = datetime.fromisoformat(created).strftime(
4143
app.config.created_at_fmt
4244
)
4345

4446
if updated:
47+
updated = re.sub(r"Z$", "+00:00", updated)
4548
context["updated_at"] = datetime.fromisoformat(updated).strftime(
4649
app.config.updated_at_fmt
4750
)

0 commit comments

Comments
 (0)