Skip to content

Fix display_time tag to parse ISO 8601 timestamps with microseconds and offsets - #257

Merged
norkans7 merged 3 commits into
mainfrom
display-time-parsing
Jul 27, 2026
Merged

Fix display_time tag to parse ISO 8601 timestamps with microseconds and offsets#257
norkans7 merged 3 commits into
mainfrom
display-time-parsing

Conversation

@norkans7

Copy link
Copy Markdown
Contributor

The display_time template tag only accepted %Y-%m-%dT%H:%M:%SZ, but API timestamps carry microseconds, so rendering real values raised ValueError and 500ed the page.

The tag now parses with datetime.fromisoformat() (handling microseconds, trailing Z and explicit offsets, with naive values assumed UTC); timezone conversion and formatting are unchanged. Tests cover all the input shapes.

@norkans7
norkans7 merged commit 5dbf2a6 into main Jul 27, 2026
15 of 21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant