aboutsummaryrefslogtreecommitdiff
path: root/themes/default/layouts/partials/meta-expiry-date.html
blob: 0521e60ef78a471cd68f7b5709efb23916a771a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{{- if .ExpiryDate -}}
  {{- $diff := now.Sub .ExpiryDate -}}
  {{- $duration := lang.FormatNumberCustom 0 (math.Round (mul (div $diff.Hours 24) -1)) -}}

  <micro-metadata-expiry>
    {{- safeHTML (readFile (print (partial "function-paths.html" "static") "/icons/feather/trash-2.svg")) -}}
    <time
      datetime= "{{- .ExpiryDate | time.Format "2006-01-02T15:04:05Z" -}}"
      title="Self destructs within {{ $duration }} days ({{ .ExpiryDate | time.Format "Monday, January 2 2006 at 15:04:05 MST" }})">
      {{- .ExpiryDate | time.Format "Jan 2 2006" -}}
{{- /* This comment removes trailing newlines and white spaces. */ -}}
    </time>
{{- /* This comment removes trailing newlines and white spaces. */ -}}
  </micro-metadata-expiry>
{{- end -}}