Hello,
- I am using
(now.AddDate 1 0 0)
without problem. - Documentation says
.AddDate
works for a time.Time variable. - When I try to apply .AddDate to a regular time.Time variable, i get a Hugo error.
- I search on a lot of changelog but could’nt find anything about a change in this area.
Any light ? Idea ?
# config.toml
params]
[params.global]
myvariable = "2019-05-01"
{{ $_x := $.Page.Site.Params.global.myvariable | time }}
{{ $_x }}
this prints 2019-05-01 00:00:00 +0000 UTC
as expected
When i try {{ $_x.AddDate 1 0 0 }}
i get this error
ERROR 2018/12/18 17:20:50 Failed to render pages: render of "page" failed: "/Users/didiergeorgieff/Documents/Git/lagouille.com/layouts/portfolio/single.html:25:6": execute of template failed: template: portfolio/single.html:24:3: executing "portfolio/single.html" at <partial "portfolio-s...>: error calling partial: "/Users/didiergeorgieff/Documents/Git/lagouille.com/layouts/partials/portfolio-single.html:25:6": execute of template failed: template:partials/portfolio-single.html:26:19: executing "partials/portfolio-single.html" at <partial "saison.html...>: error calling partial: "/Users/didiergeorgieff/Documents/Git/lagouille.com/layouts/partials/saison.html:25:6": execute of template failed: template: partials/saison.html:25:6: executing "partials/saison.html" at <$_x.adddate>: can't evaluate field adddate in type time.Time
github.com/gohugoio/hugo/hugolib.(*Site).renderPages
/private/tmp/hugo-20181128-75639-15xr3tm/hugo-0.52/src/github.com/gohugoio/hugo/hugolib/site_render.go:65
github.com/gohugoio/hugo/hugolib.(*Site).render
/private/tmp/hugo-20181128-75639-15xr3tm/hugo-0.52/src/github.com/gohugoio/hugo/hugolib/site.go:1082
github.com/gohugoio/hugo/hugolib.(*HugoSites).render
/private/tmp/hugo-20181128-75639-15xr3tm/hugo-0.52/src/github.com/gohugoio/hugo/hugolib/hugo_sites_build.go:302
github.com/gohugoio/hugo/hugolib.(*HugoSites).Build
/private/tmp/hugo-20181128-75639-15xr3tm/hugo-0.52/src/github.com/gohugoio/hugo/hugolib/hugo_sites_build.go:97
github.com/gohugoio/hugo/commands.(*commandeer).rebuildSites
/private/tmp/hugo-20181128-75639-15xr3tm/hugo-0.52/src/github.com/gohugoio/hugo/commands/hugo.go:660
github.com/gohugoio/hugo/commands.(*commandeer).handleEvents
/private/tmp/hugo-20181128-75639-15xr3tm/hugo-0.52/src/github.com/gohugoio/hugo/commands/hugo.go:942
github.com/gohugoio/hugo/commands.(*commandeer).newWatcher.func1
/private/tmp/hugo-20181128-75639-15xr3tm/hugo-0.52/src/github.com/gohugoio/hugo/commands/hugo.go:730
runtime.goexit
/usr/local/Cellar/go/1.11.2/libexec/src/runtime/asm_amd64.s:1333