Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"can't compare datetime.datetime to datetime.date" while "draft_if_future_date: true" #5618

Closed
4 tasks done
whallin opened this issue Jun 18, 2023 · 2 comments
Closed
4 tasks done
Labels
bug Issue reports a bug resolved Issue is resolved, yet unreleased if open

Comments

@whallin
Copy link

whallin commented Jun 18, 2023

Context

I'm setting up the blog plugin to work how I want it to. For example, "scheduled" blog posts should always be marked as drafts by default. But this isn't quite working the way it should, based on how the official documentation describes how it should work, at least.

Bug description

While draft_if_future_date is set to true in the blog plugin, the build always seems to fail with the error TypeError: can't compare datetime.datetime to datetime.date.

Related links

Reproduction

example.zip

Steps to reproduce

  1. Setup the blog plugin following the official documentation
  2. Set the draft_if_future_date property to true
  3. Build the site using mkdocs build (with the info plugin disabled, of course)

Browser

No response

Before submitting

@squidfunk squidfunk added needs investigation Issue must be investigated by the maintainers bug Issue reports a bug and removed needs investigation Issue must be investigated by the maintainers labels Jun 18, 2023
@squidfunk
Copy link
Owner

Thanks for reporting and for the excellent reproduction. Fixed in bd010db. Might be a regression, as this worked before. I made sure that it now works with date, as well as datetime values, e.g.:

date: 2023-08-01 # date
date: 2023-08-01T12:00:00 # datetime

@squidfunk squidfunk added the resolved Issue is resolved, yet unreleased if open label Jun 20, 2023
@squidfunk
Copy link
Owner

Released as part of 9.1.17+insiders-4.36.1!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue reports a bug resolved Issue is resolved, yet unreleased if open
Projects
None yet
Development

No branches or pull requests

2 participants