blob: c27504803ded769108098ec24766dea95822aabd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
{{- $date := .Get 0 -}}
{{- $t := time $date -}}
{{- $now := now -}}
{{- $durSeconds := sub $now.Unix $t.Unix | int -}}
{{- $days := div $durSeconds 86400 -}}
{{- if lt $days 0 -}}
{{ mul $days -1 }}
{{- else -}}
{{ $days }}
{{- end -}}
|