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.

    Recurring calendar events are off by a day

    Scheduled Pinned Locked Moved Solved Troubleshooting
    7 Posts 2 Posters 1.9k Views 2 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.
    • J Offline
      justinreimer
      last edited by

      I’ve seen a number of discussions about this topic and have tried the fixes that I’ve been able to find, but I’m still running into cases where weekly recurring events on my ical are showing up a day late.

      I believe I have set my system timezone, locale, and keyboard correctly.

      I have upgraded to the lates version of MagicMirror v2.20.0

      My timezone is PST

      Here is the VEVENT data associate with a dummy event that has this problem. When I entered this item into my calendar, I set it to happen on Thursday from 7:00PM to 7:15PM. Then I set it to be recurring. However on the MagicMirror, it shows up at 7:00 PM on Friday

      BEGIN:VEVENT
      CREATED:20220810T060530Z
      UID:029DDE3C-6248-442D-A1A1-51AB6421F5D2
      RRULE:FREQ=WEEKLY;INTERVAL=1
      DTEND;TZID=America/Los_Angeles:20220811T191500
      SUMMARY:This is a test Event
      LAST-MODIFIED:20220810T060608Z
      DTSTAMP:20220810T060608Z
      DTSTART;TZID=America/Los_Angeles:20220811T190000
      SEQUENCE:1
      END:VEVENT
      

      also, here is the config properties I have for the module

          fade: false,
          maxTitleLength: 50,
          wrapEvents: true,
          maximumEntries: 15,
          timeFormat: "absolute",
          colored: true,
          dateFormat: "hh:mma ddd MMM Do",
          fullDayEventDateFormat: "ddd MMM Do",
          getRelative: 0,
          urgency: 0
      

      @sdetweil I’m sure you’re sick of responding to these types of questions, but any ideas? You seem to be pretty involved in some of the other discussions I’ve seen on this issue.

      S 1 Reply Last reply Reply Quote 0
      • S Away
        sdetweil @justinreimer
        last edited by sdetweil

        @justinreimer yeh, SO much fun… looks like a chnage to the lower level lib has ‘fixed’ the problem I had to work around 3 years ago…

        so to test

        edit ~/MagicMirror/modules/default/calendar/calendarutils.js
        and coment out (add // to the beginning of the line)

        lines 338 and 350
        both say (one has a minus sign, one a plus sign before Math( )

        	date = new Date(date.getTime() - Math.abs(24 * 60) * 60000);
        

        and lines 366 and 378
        both say (one has a minus sign, one a plus sign before Math( )

                date = new Date(date.getTime() + Math.abs(24 * 60) * 60000);
        

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        J 1 Reply Last reply Reply Quote 0
        • J Offline
          justinreimer @sdetweil
          last edited by

          @sdetweil

          So the good news is that commenting out the above lines did fix the issue with the event I posted about above.

          The bad news is that it caused issues with other events that were previously working.

          Here’s the VEVENT data associated with one of the newly mis-behaving events

          BEGIN:VEVENT
          CREATED:20220811T165129Z
          UID:C8B93B02-3057-41F6-A69A-F4959C342E02
          RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO,WE
          DTEND;TZID=America/Los_Angeles:20220808T210000
          TRANSP:OPAQUE
          X-APPLE-TRAVEL-ADVISORY-BEHAVIOR:AUTOMATIC
          SUMMARY:My Custom Event
          LAST-MODIFIED:20220811T165146Z
          DTSTAMP:20220811T165147Z
          DTSTART;TZID=America/Los_Angeles:20220808T190000
          SEQUENCE:1
          END:VEVENT
          

          This new event that is now wrong is a weekly repeating event that is scheduled for every Monday and Wednesday at 7:00 PM. However, the calendar module on the Magic Mirror is now showing it happening every Sunday and Tuesday at 7:00 PM.

          S 2 Replies Last reply Reply Quote 0
          • S Away
            sdetweil @justinreimer
            last edited by

            @justinreimer that’s what I was afraid of.

            put them back. let me look at it some more

            thanks for the other event

            Sam

            How to add modules

            learning how to use browser developers window for css changes

            1 Reply Last reply Reply Quote 0
            • S Away
              sdetweil @justinreimer
              last edited by sdetweil

              @justinreimer the problem is the library that handles the recurring events

              sometimes it gets its date/times messed up , the new event
              if got 2 events per week, BUT used the correct DATE and the UTC TIME, and THAT turns into the day before in LA timezone. which is what the code we commented out fixes…

              [11.08.2022 12:12.47.262] [DEBUG] start: Mon Aug 08 2022 19:00:00 GMT-0700 (Pacific Daylight Time)
              [11.08.2022 12:12.47.263] [DEBUG] end:: Mon Aug 08 2022 21:00:00 GMT-0700 (Pacific Daylight Time)
              [11.08.2022 12:12.47.264] [DEBUG] duration: 7200000
              [11.08.2022 12:12.47.264] [DEBUG] title: My Custom Event
              [11.08.2022 12:12.47.265] [DEBUG] Search for recurring events between: Thu Aug 11 2022 12:12:47 GMT-0700 (Pacific Daylight Time) and Thu Aug 10 2023 23:59:59 GMT-0700 (Pacific Daylight Time)
              [11.08.2022 12:12.47.300] [DEBUG] Title: My Custom Event, with dates: ["2022-08-15T02:00:00.000Z","2022-08-17T02:00:00.000Z",
              

              except the 1st event

              [11.08.2022 12:12.46.698] [DEBUG] start: Thu Aug 11 2022 19:00:00 GMT-0700 (Pacific Daylight Time)
              [11.08.2022 12:12.46.698] [DEBUG] end:: Thu Aug 11 2022 19:15:00 GMT-0700 (Pacific Daylight Time)
              [11.08.2022 12:12.46.699] [DEBUG] duration: 900000
              [11.08.2022 12:12.46.699] [DEBUG] title: This is a test Event
              [11.08.2022 12:12.46.700] [DEBUG] Search for recurring events between: Thu Aug 11 2022 12:12:46 GMT-0700 (Pacific Daylight Time) and Thu Aug 10 2023 23:59:59 GMT-0700 (Pacific Daylight Time)
              [11.08.2022 12:12.46.782] [DEBUG] Title: This is a test Event, with dates: ["2022-08-12T02:00:00.000Z","2022-08-19T02:00:00.000Z",
              

              is processed correctly…

              unfortunately i cannot tell that one is ok, and the other is not.
              if u take off the BYDAY on the second event then its ok…

              ------
              hm… try this …

              uncomment, and add this line above each line you had commented out

                if(curEvent.rrule.origOptions.byweekday !== undefined)
              

              this checks to see if the vevent rrule explicitly specified byday… if so, it corrects…
              otherwise not

              seems to work for me

              Sam

              How to add modules

              learning how to use browser developers window for css changes

              J 1 Reply Last reply Reply Quote 0
              • J Offline
                justinreimer @sdetweil
                last edited by

                @sdetweil Yep that seems to have fixed it. Checked the next 30 events on my calendar, and they all seem to match up now. Thanks!

                S 1 Reply Last reply Reply Quote 0
                • S Away
                  sdetweil @justinreimer
                  last edited by

                  @justinreimer I have submitted fix https://github.com/MichMich/MagicMirror/pull/2905
                  for the next release

                  Sam

                  How to add modules

                  learning how to use browser developers window for css changes

                  1 Reply Last reply Reply Quote 0
                  • A akriegshauser referenced this topic on
                  • O oldrocker referenced this topic 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