Requirement: Total an extended prop on 0..n events on every day cell
I understand there are day cell render hooks like day cell content hook among other hooks that we can utilize to accomplish this. The day cell content hook looks very promising, but fails to work when the events are not all in memory and are rather loaded asynchronously because the daycells render before the data is returned. I could not find a good way to work around this short of perhaps rerendering the entire calendar when the data is returned.
Here is some example code that does some of the logic in the case the events ARE IN MEMORY, DOES NOT WORK FOR ASYNCHRONOUS EVENTS (VueJS, but should be similar for Vanilla):
injectCellContent: function(arg) { // this is the day cell content hook
let CalendarAPI = this.$refs.calendar.getApi();
let events = CalendarAPI.getEvents();
let thisDate = moment(arg.date);
let thisDaysEvents = events.filter(event => moment(event.start).isSame(thisDate, 'day'));
console.log(thisDaysEvents); // aggregate the values for events on this day
}
Thinking out loud, it almost feels like it would be intuitive to have the days events as part of the argument for the day cell render hook, but I understand they are decoupled from each other.
Question: How can I aggregate values from multiple events for a given day/date?