Read the statement by Michael Teeuw here.
MMM-CalendarExt3 - split/skip multiday events on specific days (weekends)
-
Scenario: A multiday event starts on Thursday and ends on Tuesday which means there is a multiday event bar that goes from Thursday to Tuesday (inclusive) on my calendar. The problem is that the event isn’t actually occurring on the weekend days (Saturday and Sunday for me) - the event is only applicable to the weekdays.
Is there any way to prevent the event from showing on Saturday and Sunday?
Unfortunately I don’t control the source calendar so I can’t modify it.
I tried
sliceMultiDayEvents: true
on the default calendar module source but that doesn’t appear to have made any difference in MMM-CalendarExt3. I was thinking I could use that and then figure out how to make the sliced event not show on the specific days. -
@redfishbluefish i don’t know how to fix it, but sliceMultiday happens AFTER the events have been broadcast via notification
-
@redfishbluefish
Slice first, then skip when the each event belongs to the weekends(with eventFilter or eventTransformer) -
/* config section of default calendar in config/config.js */ broadcastPastEvents: true, sliceMultiDayEvents: true,
/* config section of CX3 in config/config.js */ eventFilter: (ev) => { const day = new Date(+ev.startDate).getDay() return (ev.fullDayEvent === true && (day === 0 || day === 6)) ? false : true },
BEFORE
AFTER
ISSUES
sliceMultiDayEvents
would not emit the passed multi-day event. That’s not my fault.- looks ugly. Do you really need these splits? Generally, multi-day event means the period, not the occurrence.
Of course, you can slice events yourself for your purpose with
eventPayload
instead ofsliceMultiDayEvents
option.