{{ $date:= .Get "date" }} {{ if not $date }} {{ errorf "Error: 'date' is a required parameter." }} {{ end }} {{ $date := time.AsTime $date }} {{ $month := $date.Month | int }} {{ $year := $date.Year }} {{ $t1 := printf "%4d-%02d-01" $year $month }} {{ $t1 := time.AsTime $t1 }} {{ $t2 := $t1.AddDate 0 1 0 }} {{ $daysInMonth := $t2.Sub $t1 }} {{ $daysInMonth := $daysInMonth.Hours }} {{ $daysInMonth := div $daysInMonth 24 }} {{ $padding := $t1.Weekday | int }}
{{ if eq .Site.Language.Lang "pl" }}{{ $polish_month_names := slice "Styczeń" "Luty" "Marzec" "Kwiecień" "Maj" "Czerwiec" "Lipiec" "Sierpień" "Wrzesień" "Październik" "Listopad" "Grudzień" }}{{ $month := sub $month 1}}{{ $label := index $polish_month_names $month }}{{ printf "%s %d" $label $year }}{{ else }}{{ time.Format "January 2006" $t1 }}{{ end }}
{{ if gt $padding 0 }} {{ range seq 1 $padding }}
{{ end }} {{ end }} {{ range seq 1 $daysInMonth }}
{{ $startDate := printf "%4d-%02d-%02dT00:00:00" $year $month . }} {{ $startDate := time.AsTime $startDate }} {{ $endDate := printf "%4d-%02d-%02dT23:59:59" $year $month . }} {{ $endDate := time.AsTime $endDate }} {{ . }} ` {{ range where $.Site.RegularPages "Section" "eq" "events" }} {{ $eventStart := time.AsTime .Params.start_date | int }} {{ if after $eventStart $startDate }}

{{ .Title }}

{{ end }} {{ end }}
{{ end }} {{ range where .Site.Pages "Type" "event" }} {{ if (and (gt .Params.start_date $.Date) (lt .Params.end_date $.Date)) }}

{{ .Title }}

{{ end }} {{ end }}