{{ $dates := .dates }} {{ $on_two_lines := .on_two_lines }} {{ $type := .type }} {{ $date_format := index site.Params $type "date_format" }} {{ $time_format := index site.Params $type "time_format" }} {{ if or $dates.computed.short $dates.computed.two_lines.short $dates.from.hour $dates.to.hour }}
{{ $formated_date := $dates.computed.short }} {{ if $on_two_lines }} {{ $formated_date = $dates.computed.two_lines.short }} {{ end }} {{ with $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 $time_format }} {{- $hour = time.Format . (printf "2021-09-01T%s:00" $hour) -}} {{ end -}} {{- $hour -}} {{- end -}} {{- with $dates.to.hour -}} {{- $hour = . -}} {{- with $time_format -}} {{- $hour = time.Format . (printf "2021-09-01T%s:00" $hour) -}} {{- end -}} {{- $hour -}} {{ end -}}
{{ end -}}