diff --git a/material/plugins/blog/plugin.py b/material/plugins/blog/plugin.py index da64432dec9..6dbd4a19e9d 100644 --- a/material/plugins/blog/plugin.py +++ b/material/plugins/blog/plugin.py @@ -26,7 +26,7 @@ import yaml from babel.dates import format_date, format_datetime -from datetime import datetime +from datetime import datetime, timezone from jinja2 import pass_context from jinja2.runtime import Context from mkdocs.config.defaults import MkDocsConfig @@ -370,7 +370,7 @@ def _is_excluded(self, post: Post): # and must be explicitly enabled by the author. if not isinstance(post.config.draft, bool): if self.config.draft_if_future_date: - return post.config.date.created > datetime.now() + return post.config.date.created > datetime.now(timezone.utc) # Post might be a draft return bool(post.config.draft) diff --git a/src/plugins/blog/plugin.py b/src/plugins/blog/plugin.py index da64432dec9..6dbd4a19e9d 100644 --- a/src/plugins/blog/plugin.py +++ b/src/plugins/blog/plugin.py @@ -26,7 +26,7 @@ import yaml from babel.dates import format_date, format_datetime -from datetime import datetime +from datetime import datetime, timezone from jinja2 import pass_context from jinja2.runtime import Context from mkdocs.config.defaults import MkDocsConfig @@ -370,7 +370,7 @@ def _is_excluded(self, post: Post): # and must be explicitly enabled by the author. if not isinstance(post.config.draft, bool): if self.config.draft_if_future_date: - return post.config.date.created > datetime.now() + return post.config.date.created > datetime.now(timezone.utc) # Post might be a draft return bool(post.config.draft)