• 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.

Calendar event same start and enddate wrong (Google Calendar)

Scheduled Pinned Locked Moved Unsolved Troubleshooting
13 Posts 2 Posters 2.2k 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.
  • R Offline
    RobertM
    last edited by Nov 19, 2022, 5:48 PM

    I have some events in my Google calendar with the same start and end date, example: 13:30 to 13:00 15.11.2022

    The calendar is configured with showEnd: true, timeFormat: “dateheaders”. This 0 minutes events are displayed from the calendar module: 13:30 - 23:59 or 13:30 - 00:59.

    Any idea?

    S 1 Reply Last reply Nov 19, 2022, 5:58 PM Reply Quote 0
    • S Offline
      sdetweil @RobertM
      last edited by Nov 19, 2022, 5:58 PM

      @RobertM yes, there is a 1 second subtraction to keep from rolling over into the next time slot… midnight is 00:00 TOMORROW, 23:59:59 is today…

      Sam

      How to add modules

      learning how to use browser developers window for css changes

      R 1 Reply Last reply Nov 19, 2022, 8:54 PM Reply Quote 0
      • R Offline
        RobertM @sdetweil
        last edited by Nov 19, 2022, 8:54 PM

        Sorry, i make a mistake: The events have the same start and end time, example: 13:30 to 13:30 15.11.2022 - so a event with 0 minutes.

        S 1 Reply Last reply Nov 19, 2022, 9:58 PM Reply Quote 0
        • S Offline
          sdetweil @RobertM
          last edited by Nov 19, 2022, 9:58 PM

          @RobertM download the ics file

          at the command prompt ctrl-alt-t

          curl -sL xxxx > somefile.ics
          xxxx is the url in the mm cal config

          find that entry in the ics file (it’s just text)

          and let me see

          BEGIN:VEVENT
          ....
          END:VEVENT
          

          Sam

          How to add modules

          learning how to use browser developers window for css changes

          R 1 Reply Last reply Nov 20, 2022, 7:49 AM Reply Quote 0
          • R Offline
            RobertM @sdetweil
            last edited by Nov 20, 2022, 7:49 AM

            @sdetweil here is the requested section:

            BEGIN:VEVENT
            DTSTART:20221121T123000Z
            DTSTAMP:20221120T074630Z
            UID:4anfmr8fbcgce4qsi1675tpgcq@google.com
            CREATED:20221120T074454Z
            LAST-MODIFIED:20221120T074454Z
            LOCATION:
            SEQUENCE:0
            STATUS:CONFIRMED
            SUMMARY:XYZ-Robert (21.11.2022 13:30-13:30 MEZ)
            TRANSP:OPAQUE
            END:VEVENT
            
            S 1 Reply Last reply Nov 20, 2022, 1:05 PM Reply Quote 0
            • S Offline
              sdetweil @RobertM
              last edited by sdetweil Nov 20, 2022, 1:07 PM Nov 20, 2022, 1:05 PM

              @RobertM it has no DTEND or DURATION … so the module sets End to match Start

              from the spec
              https://icalendar.org/iCalendar-RFC-5545/3-6-1-event-component.html

              For cases where a “VEVENT” calendar component specifies a “DTSTART” property with a DATE value type but no “DTEND” nor “DURATION” property, the event’s duration is taken to be one day.

              For cases where a “VEVENT” calendar component specifies a “DTSTART” property with a DATE-TIME value type but no “DTEND” property, the event ends on the same calendar date and time of day specified by the “DTSTART” property.

              this second is the case for the event you provided

              Sam

              How to add modules

              learning how to use browser developers window for css changes

              R 1 Reply Last reply Nov 20, 2022, 1:46 PM Reply Quote 0
              • R Offline
                RobertM @sdetweil
                last edited by Nov 20, 2022, 1:46 PM

                @sdetweil Ok, that’s true for a single event.
                Bildschirmfoto 2022-11-20 um 14.38.21.png

                If I modify the event to a series event. Then the calendar module shows a wrong end date.
                Bildschirmfoto 2022-11-20 um 14.39.33.png

                In the ical file, the content is different.

                BEGIN:VEVENT
                DTSTART;TZID=Europe/Berlin:20221121T133000
                DTEND;TZID=Europe/Berlin:20221121T133000
                RRULE:FREQ=WEEKLY;BYDAY=MO
                DTSTAMP:20221120T133538Z
                UID:4anfmr8fbcgce4qsi1675tpgcq@google.com
                CREATED:20221120T074454Z
                DESCRIPTION:
                LAST-MODIFIED:20221120T133406Z
                LOCATION:
                SEQUENCE:1
                STATUS:CONFIRMED
                SUMMARY:XYZ-series
                TRANSP:OPAQUE
                END:VEVENT
                

                I indented the lines to read the values better

                 DTSTART;TZID=Europe/Berlin:20221121T133000
                   DTEND;TZID=Europe/Berlin:20221121T133000
                
                S 1 Reply Last reply Nov 20, 2022, 2:22 PM Reply Quote 0
                • S Offline
                  sdetweil @RobertM
                  last edited by Nov 20, 2022, 2:22 PM

                  @RobertM great, thanks…

                  so, I’ve found it, I don’t know why this is there or side effects…

                  but

                  edit the ~/MagicMirror/modules/default/calendar/calendarutils.js

                  find line 430-ish ( i added debug so the numbers may be off

                  						endDate = moment(parseInt(startDate.format("x")) + duration, "x");
                  						if (startDate.format("x") === endDate.format("x")) {
                  							endDate = endDate.endOf("day");
                  						}
                  

                  add the // to the endDate = line, so it looks like this

                  						endDate = moment(parseInt(startDate.format("x")) + duration, "x");
                  						if (startDate.format("x") === endDate.format("x")) {
                  							//endDate = endDate.endOf("day");
                  						}
                  

                  Sam

                  How to add modules

                  learning how to use browser developers window for css changes

                  R 1 Reply Last reply Nov 20, 2022, 2:49 PM Reply Quote 0
                  • R Offline
                    RobertM @sdetweil
                    last edited by Nov 20, 2022, 2:49 PM

                    @sdetweil yes, thats works - after restarting node - many thanks!
                    53fc0418-f977-49e2-9765-e8428500ebd2-image.png

                    Would it also be possible to only show the start of such 0 minutes events?

                    S 1 Reply Last reply Nov 20, 2022, 2:50 PM Reply Quote 0
                    • S Offline
                      sdetweil @RobertM
                      last edited by sdetweil Nov 20, 2022, 2:58 PM Nov 20, 2022, 2:50 PM

                      @RobertM i don’t think so… u asked to showEnd:true…

                      there is no conditional logic there

                      my settings and result

                      			config: {
                      				showEnd:true,
                      				timeFormat:"absolute",
                      				urgency:0,
                      				getRelative:0,
                      

                      Screenshot_2022-11-20_15-57-00.png

                      Sam

                      How to add modules

                      learning how to use browser developers window for css changes

                      R 1 Reply Last reply Nov 20, 2022, 4:52 PM Reply Quote 0
                      • 1
                      • 2
                      • 1 / 2
                      1 / 2
                      • First post
                        2/13
                        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