mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-11-13 18:40:54 +01:00
Fixe time being dropped from blog post dates
This commit is contained in:
parent
63de1a0567
commit
5b70a0cfcb
@ -62,6 +62,14 @@ class PostDate(BaseConfigOption[DateDict]):
|
|||||||
|
|
||||||
# Convert all date values to datetime
|
# Convert all date values to datetime
|
||||||
for key, value in config[key_name].items():
|
for key, value in config[key_name].items():
|
||||||
|
|
||||||
|
# Handle datetime - since datetime is a subclass of date, we need
|
||||||
|
# to check it first, or we'll loose time - see https://t.ly/-KG9N
|
||||||
|
if isinstance(value, datetime):
|
||||||
|
continue
|
||||||
|
|
||||||
|
# Handle date - we set 00:00:00 as the default time, if the author
|
||||||
|
# only supplied a date, and convert it to datetime
|
||||||
if isinstance(value, date):
|
if isinstance(value, date):
|
||||||
config[key_name][key] = datetime.combine(value, time())
|
config[key_name][key] = datetime.combine(value, time())
|
||||||
|
|
||||||
|
@ -62,6 +62,14 @@ class PostDate(BaseConfigOption[DateDict]):
|
|||||||
|
|
||||||
# Convert all date values to datetime
|
# Convert all date values to datetime
|
||||||
for key, value in config[key_name].items():
|
for key, value in config[key_name].items():
|
||||||
|
|
||||||
|
# Handle datetime - since datetime is a subclass of date, we need
|
||||||
|
# to check it first, or we'll loose time - see https://t.ly/-KG9N
|
||||||
|
if isinstance(value, datetime):
|
||||||
|
continue
|
||||||
|
|
||||||
|
# Handle date - we set 00:00:00 as the default time, if the author
|
||||||
|
# only supplied a date, and convert it to datetime
|
||||||
if isinstance(value, date):
|
if isinstance(value, date):
|
||||||
config[key_name][key] = datetime.combine(value, time())
|
config[key_name][key] = datetime.combine(value, time())
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user