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 19.0k 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
      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
            • S Offline
              SwissChemist @sdetweil
              last edited by

              @sdetweil
              maybe you expected already that now the endTime of each whole day event is shown one day too late. Without that fix, it has been correct.

              Regarding the ‘3-weekly whole day’ you gave me a perfect hint: As it is a user configured interval, you have to take care that begin of the event and day of the week you select as interval correspond. So if you configure it wrong, corresponding event will obviously not be shown, as you explained perfectly from your code analysis…

              MagicMirror_200930.JPG

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

                @sdetweil
                I would not mind to see 23:59 as end of a whole day event, but it would also be fine for me to see the day where it starts again…

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

                  @SwissChemist finding an acceptable “end” marker for “full day” event is challenging.

                  it certainly ends when the next day starts.

                  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

                    @SwissChemist can u look at this, your cal, in your timezone, 2.13 no modifications
                    showEnd:true,
                    maximumEntries:25,
                    2.13-german.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

                      @sdetweil
                      It’s getting better and better, great!

                      The only event, which is not correct yet, ist the 3-weekly 13-14. This should be in 21 days (Oct 22nd), exactly like the 3-weekly whole day. The following ones could be better controlled in an absolute time format…

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

                        @SwissChemist no… that cal entry says wednesdays, so the 21st, rule wins on exact days, start/end win on time

                        BEGIN:VEVENT
                        CREATED:20200928T173453Z
                        DTEND;TZID=Europe/Zurich:20201001T140000
                        DTSTAMP:20200928T182743Z
                        DTSTART;TZID=Europe/Zurich:20201001T130000
                        LAST-MODIFIED:20200928T182742Z
                        RRULE:FREQ=WEEKLY;INTERVAL=3;BYDAY=WE  < -------
                        SEQUENCE:0
                        SUMMARY:3-weekly 13-14
                        UID:A7C8DBD0-0AA9-468B-A3F8-A5F97B797C11
                        URL;VALUE=URI:
                        END:VEVENT
                        

                        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

                          Ok, then it’s my error again. In the meantime I have corrected my calendar entry. Would you need a new calenendar export, or would you like to send me your fix to test it here?

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

                            @SwissChemist install/upgrade to 2.13, should fix it

                            https://github.com/sdetweil/MagicMirror_scripts

                            I changed cal entry to TH, now shows 21 days, on the 22nd

                            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

                              @sdetweil

                              now I have corrected my calender entry, but I still cannot see same date for ‘3-weekly whole day’ and ‘3-weekly 13-14’.
                              Do you see same date for these events?
                              Any idea what I do wrong? Thx very much!
                              MagicMirror_201001.JPG

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

                                @SwissChemist what is your config for these entries, so I get the start formatting the same

                                never mind, copied from first entry

                                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

                                  @SwissChemist yeh, I can see the same thing, actually there is a bigger problem… see the time switch standard to daylight
                                  something happens , they go from start and end on same day to start one day end the next

                                  weekly whole day does, 6th, 13, 20, 26?? 11/2
                                  3 weekly happens around that same time, the actual clock is 10-22:22:00:00z

                                  but the whole day things look weird… start on one day, and on the next… is that 1 day or 2?
                                  all of the whole day events are '2 days actually, start on one day, end on the next

                                  one thing on the 3-weekly whole day, you have TH set as the day, if u remove that it works… the rule processor
                                  returns a different day depending.

                                  will have to examine

                                  so, something about the tz switch has messed this up… thanks for great testcase

                                  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 i think I have a test fix, incuding the time correction over dst/std time shift

                                    your timezone, all cal entries for whole day changed to 1 day (the 1st of the two listed)

                                    Screenshot at 2020-10-02 22-53-13.png

                                    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 @sdetweil
                                      last edited by SwissChemist

                                      @sdetweil
                                      I am currently not sure how this will look like after changing from DST(UTC+2) to STD time(UTC+1).
                                      For sure this will happen on sunday, 25th of October. That’s why whole day events starting on 26th look differently.
                                      But how should it look like today? Oct 26th 01:00 - Oct 27th 00:59???

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

                                        @SwissChemist install 2.13
                                        and replace the ~/MagicMirror/modules/default/calendar/calendarfetcher.js
                                        with this
                                        https://www.dropbox.com/s/t7m1f49kvv3x2b1/calendarfetcher.js?dl=0

                                        save the old one

                                        it should correct dst/std time changes

                                        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 @sdetweil
                                          last edited by

                                          @sdetweil
                                          3-weekly whole day now shows Okt 23, but it should be Okt 22

                                          As I have seen in the calendar file, switching from DST to STD time is correctly defined for last Sunday in October, that is 25th of October. So this should not influence an event on 22nd of October…

                                          Regarding events after switching from DST to STD time, I don’t have a clue, as I am not a dev, just a little experienced in testing…
                                          I tried to understand the calendar file. As far as I have seen, you have only the date for whole day events (without any time):

                                          BEGIN:VEVENT
                                          CREATED:20201001T205859Z
                                          DTEND;VALUE=DATE:20201023
                                          DTSTAMP:20201001T205900Z
                                          DTSTART;VALUE=DATE:20201022
                                          LAST-MODIFIED:20201001T205859Z
                                          RRULE:FREQ=WEEKLY;INTERVAL=3;BYDAY=TH
                                          SEQUENCE:1
                                          SUMMARY:3-weekly whole day
                                          UID:D718FE41-FF1B-43F6-9442-E9E43A41CCF0
                                          URL;VALUE=URI:
                                          END:VEVENT

                                          In this case DTSTART is 20201022 and DTEND is 20201023.

                                          For whole day events, can’t you simply set:
                                          ‘Begin’ to value of DTSTART 00:00 and
                                          ‘End’ to value of DTEND - 1day 23:59? (just as ical most probably uses 24:00 and that’s one day later)

                                          Maybe it’s not as simple as I assume, otherwise you would have tried that already…

                                          As we currently have TZOFFSET+0200 and switch to TZOFFSET+0100, I would rather expect that we see current events (planned after 25th Oct) on the monitor 1 hour too late.
                                          So that’s why I currently would rather expect:
                                          Oct 27th 01:00 - Oct 28th 00:59 for weekly whole day after switching to STD time instead of
                                          Oct 26th 23:00 - Oct 27th 22:59

                                          But as I mentioned before, maybe everything is much more complicated than I ever can imagine…
                                          MagicMirror_201003.JPG

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

                                            @SwissChemist your whole day event starts on one day, and ends on another

                                            DTEND;VALUE=DATE:20201023
                                            DTSTAMP:20201001T205900Z
                                            DTSTART;VALUE=DATE:20201022

                                            make up your mind…lol

                                            I changed all the whole day DTEND to the same date as the DTSTART

                                            Sam

                                            How to add modules

                                            learning how to use browser developers window for css changes

                                            S 1 Reply Last reply Reply Quote 0

                                            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                                            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                                            With your input, this post could be even better 💗

                                            Register Login
                                            • 1
                                            • 2
                                            • 3
                                            • 1 / 3
                                            • 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