According to the .getEvents()
documentation, it should return “all events in memory”, but when having simple recurring events outside the current view, it doesn’t.
No matter if they are dynamically added via calendar.addEvent()
or are loaded with the events
/ initialEvents
option. It also happens with any view (I’ve tried timeGrid
, dayGrid
and dayGridMonth
), while normal events not in the view do get returned as expected.
This behavior happens (at least) both in 5 (5.10.1 to be exact) and 6 (6.1.6).
You can find a runnable sample at jsfiddle, make sure you open the console. It’s pretty simple but works like this: The calendar is initialized to Jan 2023 and then normal and recurring events are added in May and Jun so they are not showing in the current view.
getEvents
returns the May one (the normal one) but not the recurrings.
There is a similar question regarding previous view-dependent bugs, but I’m surprised noone has run into this before. Is this behavior documented anywhere or am I correct in thinking this may be a bug?
I can muck around with the eventStore
, but it can get really ugly when having multiple eventSources
. Is there any API alternative to get all events? (ideally, unique ones i.e. the defs
and not the instances
themselves; but this is not a dealbreaker as I can filter them easily).