{{- if ( not ( eq (printf "%T" . ) "time.Time" ) ) -}} {{- errorf "Start date is not a `time.Time`, it's a %T" . -}} {{- end -}} {{- return ( printf "new Date('%s')" ( .Format "2006-01-02" ) ) -}}