-
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
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
Regression in TOML LocalDate Format Support #9949
Comments
I don't think we can/want to fix this, though. |
When using This issue is limited to custom front matter date fields, and date values from local and remote data files. As noted here, it would be nice if pelletier/go-toml had an option to unmarshal We've had to make adjustments here and there to accommodate
It would be nice if we could just handle it while unmarshaling. I've clarified the time.Format documentation here. |
What version of Hugo are you using (
hugo version
)?hugo v0.87.0-B0C541E4 linux/amd64 BuildDate=2021-08-03T10:57:28Z VendorInfo=gohugoio
hugo v0.99.1-d524067382e60ce2a2248c3133a1b3af206b6ef1 linux/amd64 BuildDate=2022-05-18T11:18:14Z VendorInfo=gohugoio
hugo v0.86.0-41C6C52E linux/amd64 BuildDate=2021-07-21T09:53:14Z VendorInfo=gohugoio
Issue
This is quite a minor issue as there is a solution. Feel free to close this if I've misunderstood and this isn't a valid regression.
In Hugo before v0.87 you could use the
.Format
method on atoml.LocalDate
date. Since then with the new TOML backend and updated.Format
functionality it errors.For
hugo <= 0.86
, given the toml:This template renders correctly:
From
hugo >= 0.87
it errors with:However, calling
time.Format
directly and passing intoml.LocalDate
as an argument does correctly render.Shouldn't
toml.LocalDate
(which can be coerced into atime.Time
) be treated as a just like regular a TOML Offset Date-Time (which I think are automaticallytime.Time
ingo-toml
).The text was updated successfully, but these errors were encountered: