mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-22 21:42:50 +02:00
tpl/time: Use configured location when date passed to Format is string
Updates #9084
This commit is contained in:
@@ -63,7 +63,7 @@ func (ns *Namespace) AsTime(v interface{}, args ...interface{}) (interface{}, er
|
||||
// the other form or returns it of the time.Time value. These are formatted
|
||||
// with the layout string
|
||||
func (ns *Namespace) Format(layout string, v interface{}) (string, error) {
|
||||
t, err := cast.ToTimeE(v)
|
||||
t, err := htime.ToTimeInDefaultLocationE(v, ns.location)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
Reference in New Issue
Block a user