When looping through all events in Twig, repeated events will continuously come in. On a weekly event, for instance, it pulls one for this week, one for next week, etc. Lets say I have a meeting event set to repeat weekly, it would come back like this:
{% for event in craft.calendar.events %} ...
Meeting Event
Meeting Event
Meeting Event
...
I'm looking to load events asynchronously with the Element API plugin but I'm only able to get back each event once (even the repeated ones). How do I achieve the same behavior? Here is the basic setup:
<?php
namespace Craft;
return [
'endpoints' => [
'api/events.json' => function() {
return [
'elementType' => 'Calendar_Event'
];
}
]
];
And it only returns:
Meeting Event