{{ $dates := .dates }} {{ $layout := .layout }} {{ if or $dates.computed.short $dates.computed.two_lines.short $dates.from.hour $dates.to.hour }}

{{ $formated_date := $dates.computed.two_lines.short }} {{ if ne $layout "list" }} {{ $formated_date = $dates.computed.short }} {{ end }} {{ with site.Params.events.date_format }} {{ $formated_date = time.Format . $dates.from.day }} {{ if ne $dates.from.day $dates.to.day }} {{ $formated_date = printf "%s%s" $formated_date ( time.Format . $dates.to.day ) }} {{ end }} {{ end }} {{ partial "PrepareHTML" $formated_date }}

{{- if (or $dates.from.hour $dates.to.hour) }} {{- $hour := "" -}}

{{ with $dates.from.hour }} {{- $hour = . -}} {{- with site.Params.events.time_format }} {{- $hour = time.Format . (printf "2021-09-01T%s:00" $hour) -}} {{ end -}} {{- $hour -}} {{- end -}} {{- with $dates.to.hour -}} {{- $hour = . -}} {{- with site.Params.events.time_format -}} {{- $hour = time.Format . (printf "2021-09-01T%s:00" $hour) -}} {{- end -}} {{- $hour -}} {{ end -}}

{{ end -}}
{{ end }}