Hi,
I want to range over an array of events ( ‘nextDates’ ) and print out the first 4 that are
- in the future
- are not ‘full’
The array ‘nextDates’ is structured like this:
- 2:
date: 2023-02-28T18:00:00+01:00
weekday: Dienstag
full: false
- 3:
date: 2023-04-11T18:00:00+01:00
weekday: Dienstag
full: true
- 4:
date: 2023-05-23T18:00:00+01:00
weekday: Dienstag
full: false
So far I’ve been printing out all events like this:
{{ range .Params.nextDates }}
{{ if (and ((time .date).After now) (not .full)) }}
<span>{{ dateFormat "2.1.2006" .date }}</span>
{{ end }}
{{ end }}
I am struggling with limiting the output to only the first 4.