timetable icon indicating copy to clipboard operation
timetable copied to clipboard

All-Day Event Stacking Limit

Open SApolinario opened this issue 2 years ago • 2 comments

Would it be possible to limit the number of stocked all-day events that get displayed on a particular day? It's an edge case I'm sure but some people have 10+ all-day events specified in their calendar. Would be nice to have a "+ n more" option to reveal the additional items instead of stacking them all.

Would you have any suggestions as to how to handle this in the meantime?

Thanks

Samuel

SApolinario avatar Jul 15 '21 13:07 SApolinario

Yeah, that's probably necessary. #63 also describes the issue of having too many all-day events so that they even cause a layout overflow, but I haven't yet gotten the time to implement a fix. An additional fixed limit sounds like a good idea as well.

In the meantime, you could count the all-day events you return in the event provider and if there are too many, remove some of them and instead add a dummy "event" whose title is "+n". If the user then taps that event, you could open an overlay that contains the remaining events.

JonasWanke avatar Jul 15 '21 14:07 JonasWanke

Yeah I realize a fixed limit may be somewhat tricky as events can potentially span multiple days. FullCalendar seems to have a decent implementation. May be worth looking at when and if you do decide to take this up: https://fullcalendar.io/docs/v4/eventLimit

"In the meantime, you could count the all-day events you return in the event provider and if there are too many, remove some of them and instead add a dummy "event" whose title is "+n". If the user then taps that event, you could open an overlay that contains the remaining events."

Yeah not sure how I'd do that considering the event provider requests all events for a given range of dates. Maybe it'll be easier if I fork the package and make the necessary mod.

Thanks for your quick response. Much appreciated!

Samuel

SApolinario avatar Jul 15 '21 14:07 SApolinario

I've added this as part of v1.0.0-alpha.9. You can now specify multiDateEventHeaderStyle.maxEventRows (defaults to showing up to three rows plus one with overflow indicators) and multiDateTimetableStyle.maxHeaderFraction (defaults to 0.5). You can react to taps on these overflows using timetableCallbacks.onMultiDateHeaderOverflowTap or customize the overflow widgets themselves using defaultEventBuilder.allDayOverflowBuilder (builds MultiDateEventHeaderOverflow by default).

JonasWanke avatar Aug 19 '22 13:08 JonasWanke