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-Calendar always shows 23:59 if showEndTime: True

    Scheduled Pinned Locked Moved Bug Hunt
    51 Posts 4 Posters 16.5k 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.
    • S Offline
      SwissChemist
      last edited by SwissChemist

      Dear Sam,
      I have exactly done what is written in your instructions.
      The start date is shown correctly, but there are two issues left:

      1. with ‘showEnd: True’ I can see 23:59 for recurring events (not whole day) on my calendar. (With non recurring events, the end time is correct!)
      2. some dates for recurring events (whole day) are wrong.

      I have prepared an ics-file and a screenshot of my MagicMirror Monitor for comparison.

      The following dates are wrong:
      3-weekly whole day - 22.Okt should be: 21.Okt
      Weekly whole day - 26.Okt should be: 27.Okt
      2-weekly whole day - 27.Okt should be: 28.Okt
      Monthly whole day - 1.Nov should be 2.Nov
      Weekly whole day - 2.Nov should be 3.Nov
      Weekly whole day - 9.Nov should be 10.Nov
      2-weekly whole day - 10.Nov should be 11.Nov
      …
      I have defined a test calendar, ich which all weeklys are planned for the same day, all 2-weeklys are planned for the same day, all 3-weeklys are planned for the same day. So you can easily see if these dates differ, there is a mistake…
      Files and a MagicMirror picture are attached.

      Thanks very much for your support!

      ![0_1601321066459_MagicMirror.JPG](Uploading 100%)
      [0_1601321084756_myCalendar](Uploading 100%)

      S 1 Reply Last reply Reply Quote 0
      • S Offline
        sdetweil @SwissChemist
        last edited by

        @SwissChemist please see my cat message…

        i assume you are gmt+ something…

        there is a newly found bug in the repeating rule parser, which I am working on. but it might be a while…

        if the normal time of the event is not exceeded by your tz offset then the event date is (in gmt) the prior day.
        then the rule calculates, and gets the current day, and the jams the prior to midnight time onto the event, now it is 24 hours later…

        at the time the calculation and adjustment is done, the rule processor doesn’t know the original effect of the timezone offset

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        S 1 Reply Last reply Reply Quote 0
        • S Offline
          SwissChemist
          last edited by

          You are right, now in summer, we are GMT+1, in winter it’s GMT+2…

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

            @SwissChemist

            no the one I am fighting from Australia

            meeting at 09/28/20, 08:30
            utc is 09/27/20, 22:30

            rule detemines today is valid DATE
            takes todays date 09/28, with yesterdays time 22:30
            oops…

            Sam

            How to add modules

            learning how to use browser developers window for css changes

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

              @sdetweil so, your 1st entry is confusing… label is
              SUMMARY:Monthly 17-18
              but the cal entry says
              DTSTART;TZID=Europe/Zurich:20201002T170000, Oct 02, 1700 local, 1500 utz

              Sam

              How to add modules

              learning how to use browser developers window for css changes

              1 Reply Last reply Reply Quote 0
              • S Offline
                sdetweil
                last edited by

                also, showEnd is a pain… technically the clock is day:00:00 to day 23:59 as 23:59+1 is 24:00/00:00 which is the next day

                so, what do you think we should be showing there…

                Sam

                How to add modules

                learning how to use browser developers window for css changes

                S 1 Reply Last reply Reply Quote 0
                • S Offline
                  sdetweil @SwissChemist
                  last edited by sdetweil

                  @SwissChemist want to try a fix for me…

                  edited: changed added line

                  edit the ~/MagicMirror/modules/default/calendar/calendarfetcher.js
                  find this (approx line 240) and add the one line listed below

                  						// Loop through the set of date entries to see which recurrences should be added to our event list.
                  						for (let d in dates) {
                  							const date = dates[d];
                  							// ical.js started returning recurrences and exdates as ISOStrings without time information.
                  							// .toISOString().substring(0,10) is the method they use to calculate keys, so we'll do the same
                  							// (see https://github.com/peterbraden/ical.js/pull/84 )
                  							const dateKey = date.toISOString().substring(0, 10);
                  							let curEvent = event;
                  							let showRecurrence = true;
                  							let duration = 0;
                  
                  							startDate = moment(date);
                  							duration = parseInt(moment(curEvent.end).format("x")) - parseInt(moment(curEvent.start).format("x")) // --- add this line
                  

                  in your timezone (mine is Sep 28, 17:15)

                  Screenshot at 2020-09-29 00-14-48.png

                  Sam

                  How to add modules

                  learning how to use browser developers window for css changes

                  1 Reply Last reply Reply Quote 0
                  • S Offline
                    SwissChemist
                    last edited by SwissChemist

                    Hello Sam,
                    thanks very much for your great support.
                    Good news is that the endTime issue is solved now!

                    Nevertheless with recurring whole day events, the following entries are not correct yet:

                    3-weekly 13-14 is completely missing (should be 1.Okt)

                    Starting with the 3-weekly whole day 22.Okt (should be 21.Okt), every following ‘whole day meeting’ is shown one day too late.
                    You can easily see that even on your picture, as e.g. the 3-weekly whole day and the 3-weekly 13-14 should always take place at the same date.

                    Even on your picture this is not the case… monthly whole day is shown in 3 days, monthly 17-18 is shown in 4 days.

                    Once more, thanks for your great support so far!
                    ![0_1601412306493_MagicMirror_200929.JPG](Uploading 100%)

                    1 Reply Last reply Reply Quote 0
                    • S Offline
                      sdetweil
                      last edited by

                      yeh, that whole day thing… the spec says its whole day in the timezone where the computer is.
                      but the ical converter still adjusts it to UTC. (all parsed events are in UTC)

                      3-weekly 13-14 is completely missing (should be 1.Okt)
                      can’t be cause u asked for WEdnesdays

                      
                      BEGIN:VEVENT
                      CREATED:20200928T173050Z
                      DTEND;VALUE=DATE:20201002
                      DTSTAMP:20200928T182733Z
                      DTSTART;VALUE=DATE:20201001
                      LAST-MODIFIED:20200928T182732Z
                      RRULE:FREQ=WEEKLY;INTERVAL=3;BYDAY=WE  < ----
                      SEQUENCE:0
                      SUMMARY:3-weekly whole day
                      UID:E2C82F47-1E0F-4FD0-93C4-746B2D53488B
                      URL;VALUE=URI:
                      END:VEVENT
                      

                      so , this repeating event might start on Oct 1, but thats a thursday, so will not be shown
                      Screenshot at 2020-09-29 23-44-05.png

                      but later, Starting with the 3-weekly whole day 22.Okt (should be 21.Okt),
                      starts on 21+1 days from today 00:00:00 Oct 21, and ends on Oct 22

                      this is a fix in the ical parser… so, it will take time to get out…

                      Sam

                      How to add modules

                      learning how to use browser developers window for css changes

                      1 Reply Last reply Reply Quote 0
                      • S Offline
                        sdetweil
                        last edited by

                        can we try another quick fix?

                        in calendar.js

                        				// Define second, minute, hour, and day variables
                        				var oneSecond = 1000; // 1,000 milliseconds
                        				var oneMinute = oneSecond * 60;
                        				var oneHour = oneMinute * 60;
                        				var oneDay = oneHour * 24;
                        				if (event.fullDayEvent) {
                        					//subtract one second so that fullDayEvents end at 23:59:59, and not at 0:00:00 one the next day
                        					//event.endDate -= oneSecond;   < ---- comment out this one line
                        

                        Sam

                        How to add modules

                        learning how to use browser developers window for css changes

                        S 1 Reply Last reply Reply Quote 0
                        • 1
                        • 2
                        • 3
                        • 4
                        • 5
                        • 6
                        • 1 / 6
                        • 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