{{/* Title */}}
{{ .Title }}
{{/* Subtitle */}}
{{ with .Params.subtitle }}
{{ . }}
{{ end }}
{{/* Period */}}
{{ if .Params.startDate }}
From {{ dateFormat .Site.Params.projects.date_format .Params.startDate }}
{{ if .Params.endDate }}
{{ $end := (time .Params.endDate) }}
{{ $duration := $end.Sub (time .Params.startDate) }}
{{ $months := int (div (int (div $duration.Hours 24)) 30.4167) }}
{{ $years := int (div $months 12) }}
{{ $months := int (sub $months (mul $years 12)) }}
to {{ dateFormat .Site.Params.projects.date_format .Params.endDate }}
| {{ if gt $years 0 }}{{ $years }} year{{ if gt $years 1 }}s{{ end }}{{ end }}{{ if and (gt $years 0) (gt $months 0) }}, {{ end }}{{ if gt $months 0 }}{{ $months }} month{{ if gt $months 1 }}s{{ end }}{{ end }}
{{ end }}
{{ end }}