Struggling to get my head around this one, hoping someone can help.
I have a page called timeline it has many children that are timeline events and each has a date field.
In my controller what I am trying to do is this:
Get the date (event_date) from all of the children.
Extract the year from each date but return only the unique years.
But, a further twist is that I only want years between 1933-1945.
Then I can return that array of years to the page and loop through to display.
What would be your approach to this?
Thanks very much for any comments. For reference, if it helps to understand, see a screenshot of my local test site with Laravel where I did it. Relates only to that top row of years you can see. Just can’t figure out how to duplicate with Kirby.
Thank you, I am overthinking it as always and of course the way Laravel uses map should never be assumed to be the way other software or just simple PHP uses it!