-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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
Date comparison fails with unqualified date values #12236
Comments
Your Hugo versions, are they built with the same Go version? |
|
OK, I think I remember seeing something about time equality in go1.22.0 release notes, but it wasn't a "red flag" for me, but I may have been mistaken. |
I know I've used this in templates: https://pkg.go.dev/time#Time.Equal
Not sure what we're using internally. |
The template workaround is to do this:
instead of this:
|
We use This means that we can easily fix the above failing case, but it would still fail on:
I suggest that we:
|
But they're not equal... It seems to me that the comparison provided the expected result (from a user's standpoint) because of how we set the fallback values in v0.122.0. It seems like that is what changed. |
Yea, right ... OK, now I see it. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
This worked as expected in v0.122.0, fails in v0.123.x.
site config
content/p1.md
layouts/_default/single.html
expected (v0.122.0)
actual (v0.123.x)
Both are correct (they point to the same moment in time), but the two values are not equal.
Reference: https://discourse.gohugo.io/t/if-eq-date-lastmod-0-123-8/48798
The text was updated successfully, but these errors were encountered: