summaryrefslogtreecommitdiffstats
path: root/tpl/time
AgeCommit message (Collapse)Author
2021-10-30tpl/time: Use configured location when date passed to Format is stringBjørn Erik Pedersen
Updates #9084
2021-08-10Revert "tpl/time: Handle nil values in time.AsTime"Bjørn Erik Pedersen
This reverts commit 3e11072892ca31bb76980ee38890a4bd92d83dfd.
2021-08-09tpl/time: Handle nil values in time.AsTimeBjørn Erik Pedersen
Closes #8865
2021-08-03tpl/time: Adjust tests to handle matching local time zonesBjørn Erik Pedersen
Closes #8843
2021-08-02Reduce binary size vs locale, update to CLDR v36.1Bjørn Erik Pedersen
Test building with `go build -ldflags="-s -w"` Hugo 0.86.2: 46MB Before this commit: 77MB After this commit: 54MB Fixes #8839 Fixes #8841
2021-08-01Fix error handling for the time func aliasBjørn Erik Pedersen
Fixes #8835
2021-07-29tpl/lang: Add new localized versions of lang.FormatNumber etc.Bjørn Erik Pedersen
Fixes #8820
2021-07-28Handle toml.LocalDate and toml.LocalDateTime in front matterBjørn Erik Pedersen
See #8801
2021-07-27Add timezone support for front matter dates without oneBjørn Erik Pedersen
Fixes #8810
2021-07-27Localize time.FormatBjørn Erik Pedersen
Fixes #8797
2020-12-03all: Format code with gofumptBjørn Erik Pedersen
See https://github.com/mvdan/gofumpt
2020-10-21tpl: Refactor time.AsTime location implementationCameron Moore
2020-10-21tpl: Update Hugo time to support optional [LOCATION] parameterMark Johnson
2019-08-12tests: Convert from testify to quicktestBjørn Erik Pedersen
2018-11-30tpl: Add godoc packages commentsCameron Moore
Also fix package name in tpl/templates.
2017-09-09tpl/time: Add time.Duration and time.ParseDuration template funcsBjørn Erik Pedersen
And with time.Duration with the convenient alias `duration`: ``` {{ mul 60 60 | duration "second" }} ``` Fixes #3828
2017-06-13all: Update import paths to gohugoio/hugoBjørn Erik Pedersen
2017-05-20tpl/time: Re-add the time exampleBjørn Erik Pedersen
2017-05-20tpl: Make the Namespace func signature explicitBjørn Erik Pedersen
This makes it cleaner and avoids breaking client code, such as the docs helper JSON generator.
2017-05-20tpl/time: Remove asTime template func mappingCameron Moore
2017-05-20tpl/time: Support overlapping namespace and template funcCameron Moore
Fixes #3421
2017-05-02tpl: Add basic tests for all namespace init funcsCameron Moore
2017-05-01tpl: Add docshelper for template funcsBjørn Erik Pedersen
And fix some other minor related issues. Updates #3418
2017-05-01tpl: Fix the remaining template funcs namespace issuesBjørn Erik Pedersen
See #3042
2017-05-01tpl/time: Make it a package that stands on its ownBjørn Erik Pedersen
See #3042
2017-04-30tpl: Add template function namespacesCameron Moore
This commit moves almost all of the template functions into separate packages under tpl/ and adds a namespace framework. All changes should be backward compatible for end users, as all existing function names in the template funcMap are left intact. Seq and DoArithmatic have been moved out of the helpers package and into template namespaces. Most of the tests involved have been refactored, and many new tests have been written. There's still work to do, but this is a big improvement. I got a little overzealous and added some new functions along the way: - strings.Contains - strings.ContainsAny - strings.HasSuffix - strings.TrimPrefix - strings.TrimSuffix Documentation is forthcoming. Fixes #3042