• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
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.

2.30.0 and MMM-CalendarExt3 missing calendars

Scheduled Pinned Locked Moved Solved Troubleshooting
29 Posts 3 Posters 3.6k Views 4 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 @sdetweil
    last edited by Jan 2, 2025, 8:40 PM

    @sdetweil I saw your note in the other thread about setting maximumEntries per calendar. I guess it means with this change there’s more thought required to determine the “right” values for each of the calendars you want to add.

    Example: As of today, Jan 2, this configuration for the calendar will show the “New Year’s Day” event on CalendarExt3:

    config: {
    	broadcastPastEvents: true,
    	calendars: [
    	{
    		url: "https://ics.calendarlabs.com/39/f7480acf/Canada_Holidays.ics",
    		name: "can_holiday",
    		maximumEntries: 16,
    	},
    },
    

    The following configuration will not show the “New Year’s Day” event:

    config: {
    	broadcastPastEvents: true,
    	calendars: [
    	{
    		url: "https://ics.calendarlabs.com/39/f7480acf/Canada_Holidays.ics",
    		name: "can_holiday",
    		maximumEntries: 15,
    	},
    },
    

    If I set maximumNumberOfDays: 180 then it actually changes the start date of the event array sliding window and the “New Year’s Day” event will show if maximumEntries: 15.

    Which makes me realize that the combination of:

    broadcastPastEvents: true,
    maximumNumberOfDays: 365, // default value
    

    will actually return 2 years worth of events (assuming you don’t exceed the maximumEntries setting).

    S 1 Reply Last reply Jan 2, 2025, 9:04 PM Reply Quote 0
    • S Offline
      sdetweil @redfishbluefish
      last edited by Jan 2, 2025, 9:04 PM

      @redfishbluefish well… could be up to 2 years if maximumNumberOfDays is 365 (default)

      for each calendar ({…url…})
      get the cal maximumEvents (specified, or default if not)

      //new code
      save that ONLY cal maximumEvents on the list of total events
      this COULD clip off events…
      //
      old code , save cal events on list of total events (all from cal)
      //
      we process the ical in the order presented, we ‘assume’ it is date ordered,
      but do not check…

      sort the events by date   // ONLY time ALL events are sorted in order explicitly
         this WILL intermingle events from different cals by date
      

      send that to the other modules
      in the ui
      clip list to the FIRST maximumEvents. (old and new)
      we COULD have too many OLD events and end up with no UPCOMING events in the list

      I’ve been thinking about that problem… and i think the only non-disruptive way to fix it is to clip NEW events only… that means we would have to FIND the point in the list for first new event, or last old event

      so it there are 300 events, and max entries is 10, today we use the first 10, and could throw away 290
      if in the 300 its 250 old and 50 new, we would never see the new, even with maxevents set to 200
      but if we JUST clipped new
      we would have sent 260… 250 and 10 new then we wouldn’t have these crazy UI troubles with maxevents flooding the screen (cause maxevents 10 would give us 10 for the screen)
      because we had to get maximum events up to get to the new ones in the total list

      Sam

      How to add modules

      learning how to use browser developers window for css changes

      R 1 Reply Last reply Jan 2, 2025, 10:51 PM Reply Quote 0
      • R Offline
        redfishbluefish @sdetweil
        last edited by Jan 2, 2025, 10:51 PM

        @sdetweil thank you for supporting the calendar module!

        For my specific use case, I don’t display the default calendar module, it’s just used to fetch and broadcast events for CalendarExt3. With this in mind, the idea of a sliding window centered on a date (today in most cases) makes the most sense to me.

        Is there a reason why the default for maximumEntries is 10? I had assumed performance but it looks like this is actually what’s used to control the number of events displayed.

        S 1 Reply Last reply Jan 2, 2025, 11:22 PM Reply Quote 0
        • S Offline
          sdetweil @redfishbluefish
          last edited by Jan 2, 2025, 11:22 PM

          @redfishbluefish i do not know, been that way since i got here in 2017. i assume it was for the display list.

          generally you try to add without breaking old stuff.

          i didn’t start working on cal til 21, when our users kept having trouble. same thing as now. mostly work on the event parser

          Sam

          How to add modules

          learning how to use browser developers window for css changes

          S 1 Reply Last reply Jan 3, 2025, 1:42 PM Reply Quote 0
          • S Offline
            sdetweil @sdetweil
            last edited by Jan 3, 2025, 1:42 PM

            @redfishbluefish
            apply this fix
            see
            https://forum.magicmirror.builders/topic/19282/version-2-30-0-calendar-fix-for-clipping-broadcast-events

            Sam

            How to add modules

            learning how to use browser developers window for css changes

            R 1 Reply Last reply Jan 3, 2025, 4:07 PM Reply Quote 1
            • R Offline
              redfishbluefish @sdetweil
              last edited by Jan 3, 2025, 4:07 PM

              @sdetweil thanks for the fix! I really appreciate your effort.

              Just in case it’s useful for someone else who runs into the same problem, with the fix applied and my calendar configuration that worked in 2.29.0, I see:

              [Debug] [Calendar] self update (calendar.js, line 950)
              [Debug] pushing 18 events to total with room for 10 (calendar.js, line 695)
              [Debug] events for calendar=10 (calendar.js, line 697)
              [Debug] pushing 246 events to total with room for 10 (calendar.js, line 695)
              [Debug] events for calendar=20 (calendar.js, line 697)
              [Info] sorting events count=20 (calendar.js, line 699)
              [Info] slicing events total maxcount=10 (calendar.js, line 739)
              

              And when I set a new maximumEntries per calendar I get:

              [Debug] pushing 34 events to total with room for 50 (calendar.js, line 695)
              [Debug] events for calendar=34 (calendar.js, line 697)
              [Debug] pushing 295 events to total with room for 500 (calendar.js, line 695)
              [Debug] events for calendar=329 (calendar.js, line 697)
              [Info] sorting events count=329 (calendar.js, line 699)
              

              This does result in a different behaviour for users of other calendar modules as of 2.30.0 so might be handy if the authors could update their recommendations in their documentation?

              S 1 Reply Last reply Jan 3, 2025, 4:20 PM Reply Quote 0
              • R redfishbluefish has marked this topic as solved on Jan 3, 2025, 4:08 PM
              • S Offline
                sdetweil @redfishbluefish
                last edited by Jan 3, 2025, 4:20 PM

                @redfishbluefish the pushing events for cal
                thru to before the last sorting are ONLY used for the UI, not for the broadcast

                the broadcast does NOT clip AT ALL with this fix, just like before
                IF you don’t have the UI visible(position commented out or not supplied in default cal) , all of this is noise (wasted logging)

                Sam

                How to add modules

                learning how to use browser developers window for css changes

                1 Reply Last reply Reply Quote 0
                • 1
                • 2
                • 3
                • 3 / 3
                3 / 3
                • First post
                  27/29
                  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