Skip to content

Commit

Permalink
Fixed blog plugin crashing on dates with timezones (#7708)
Browse files Browse the repository at this point in the history
* Normalize datetime values to UTC in blog plugin

Fixes #7705

Normalize datetime values to UTC in blog plugin to handle offset-naive and offset-aware datetimes correctly.

* Import `timezone` from `datetime` in `material/plugins/blog/structure/options.py`.
* Modify `pre_validation` method to set `tzinfo=timezone.utc` for datetime values.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/squidfunk/mkdocs-material/issues/7705?shareId=XXXX-XXXX-XXXX-XXXX).

* Normalize datetime values to UTC in blog plugin

Fixes #7705

+ Move changes to src directory
  • Loading branch information
perpil authored Nov 19, 2024
1 parent d4f0b66 commit a08809a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions material/plugins/blog/structure/options.py
6 changes: 3 additions & 3 deletions src/plugins/blog/structure/options.py

0 comments on commit a08809a

Please sign in to comment.