Skip to content

Commit 1ab95aa

Browse files
committed
add timezone to title in span
1 parent 2fd812f commit 1ab95aa

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/mkdocs_git_revision_date_localized_plugin/dates.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ def get_date_formats(
3333
loc_revision_date.strftime("%H:%M:%S"),
3434
]
3535
),
36+
"datetime-timezone": " ".join(
37+
[
38+
format_date(loc_revision_date, format="long", locale=locale),
39+
loc_revision_date.strftime("%H:%M:%S %Z"),
40+
]
41+
),
3642
"iso_date": loc_revision_date.strftime("%Y-%m-%d"),
3743
"iso_datetime": loc_revision_date.strftime("%Y-%m-%d %H:%M:%S"),
3844
"timeago": '<span class="timeago" datetime="%s" locale="%s"></span>' % (loc_revision_date.isoformat(), locale),

src/mkdocs_git_revision_date_localized_plugin/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ def add_spans(date_formats: Dict[str, str]) -> Dict[str, str]:
230230
"""
231231
Wraps the date string in <span> elements with CSS identifiers.
232232
"""
233-
datetime_string = date_formats["datetime"]
233+
datetime_string = date_formats["datetime-timezone"]
234234
for date_type, date_string in date_formats.items():
235235
date_formats[date_type] = (
236236
'<span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-%s" title="%s">%s</span>'

0 commit comments

Comments
 (0)