MCPcopy
hub / github.com/flosch/pongo2 / filterDate

Function filterDate

filters_builtin.go:554–563  ·  view source on GitHub ↗
(in *Value, param *Value)

Source from the content-addressed store, hash-verified

552}
553
554func filterDate(in *Value, param *Value) (*Value, *Error) {
555 t, isTime := in.Interface().(time.Time)
556 if !isTime {
557 return nil, &Error{
558 Sender: "filter:date",
559 OrigError: errors.New("filter input argument must be of type 'time.Time'"),
560 }
561 }
562 return AsValue(t.Format(param.String())), nil
563}
564
565func filterFloat(in *Value, param *Value) (*Value, *Error) {
566 return AsValue(in.Float()), nil

Callers

nothing calls this directly

Calls 3

AsValueFunction · 0.85
InterfaceMethod · 0.80
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…