MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    MMM-CalendarExt3 - split/skip multiday events on specific days (weekends)

    Scheduled Pinned Locked Moved Solved Troubleshooting
    5 Posts 3 Posters 308 Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • R Offline
      redfishbluefish
      last edited by

      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.

      S M 3 Replies Last reply Reply Quote 0
      • S Offline
        sdetweil @redfishbluefish
        last edited by

        @redfishbluefish i don’t know how to fix it, but sliceMultiday happens AFTER the events have been broadcast via notification

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        1 Reply Last reply Reply Quote 0
        • M Offline
          MMRIZE @redfishbluefish
          last edited by

          @redfishbluefish
          Slice first, then skip when the each event belongs to the weekends(with eventFilter or eventTransformer)

          1 Reply Last reply Reply Quote 0
          • M Offline
            MMRIZE @redfishbluefish
            last edited by MMRIZE

            @redfishbluefish

            /* 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
            6ac6d515-19db-46e9-b41b-f7f72a383f0f-image.png

            AFTER
            e68968b2-ab5d-405e-bc7c-226442eb21ef-image.png

            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 of sliceMultiDayEvents option.

            R 1 Reply Last reply Reply Quote 0
            • R Offline
              redfishbluefish @MMRIZE
              last edited by

              @MMRIZE thanks for the details! I spent some time working with this and ended up leaving it as the default behaviour.

              1 Reply Last reply Reply Quote 0
              • R redfishbluefish has marked this topic as solved on
              • 1 / 1
              • First post
                Last post
              Enjoying MagicMirror? Please consider a donation!
              MagicMirror created by Michael Teeuw.
              Forum managed by Sam, technical setup by Karsten.
              This forum is using NodeBB as its core | Contributors
              Contact | Privacy Policy