• 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 timezone problems

Scheduled Pinned Locked Moved Solved Troubleshooting
10 Posts 6 Posters 2.8k Views 6 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.
  • M Offline
    mlcampbe
    last edited by Jun 7, 2019, 5:19 PM

    I’m using the default MM calendar and having problems with it displaying event timezones properly.

    I am displaying a work calendar and for the most part my co-workers are in ET while I am in CT - a 1 hour difference. When they create an event for me MM shows the time in ET as it was created, not in CT where myself and the MM are located.

    For example, if someone creates and event that starts at 2pm ET that would be 1pm CT for me. However, when MM refreshes and displays the relative time it is 1 hour off.

    Example:
    event scheduled for 2pm ET/1pm CT
    current time 1:15pm ET/12:15pm CT
    MM displays the event starting in 2 hours

    Another example:
    same event scheduled for 2pm ET/1pm CT
    current time 2:05pm ET/1:05pm CT
    MM displays the event starting in 55 min

    So it appears that MM is reading the timezone the event was created in not the timezone of the pi (as I have verified the pi has the correct CT setting).

    Any ideas how to fix this? Any other calendar module that might handle this differently such as jclarke0000/MMM-MyCalendar?

    I note that the calendar module uses ical.js so any change there is a bug in it?

    1 Reply Last reply Reply Quote 0
    • M Offline
      mlcampbe
      last edited by Jun 7, 2019, 5:38 PM

      Just a quick update and I have tested MMM-MyCalendar from jclarke0000 and it does not work either. It shows the same 1 hour discrepency.

      1 Reply Last reply Reply Quote 0
      • M Offline
        mlcampbe
        last edited by Jul 17, 2019, 9:23 PM

        I’ve solved this problem by replacing the node-ical script that the default calendar modules uses with a fork of it.

        I did some research and found that the default calendar module uses the node-ical modules to parse calendar data. I notice that it is based off of https://github.com/peterbraden/ical.js. I also found https://github.com/jens-maus/node-ical that is based off of the original peterbraden/ical.js. but seems to have been updated to use the npm package moment-timezone.

        I did a drop in replacement and it seems to work:

        cd modules/default/calendar/vendor
        mv ical.js ical.js.orig
        git clone https://github.com/jens-maus/node-ical
        mv node-ical/ ical.js
        cd ical.js
        npm install

        Restarted MM and now my timezones are showing up properly. So I made my own modules out of this so it won’t get overwritten by updates.

        S R B 3 Replies Last reply Jan 27, 2020, 3:29 PM Reply Quote 0
        • N Offline
          nimbu
          last edited by Aug 22, 2019, 7:00 PM

          @mlcampbe said in Calendar timezone problems:

          i

          Didnt work for me unfortunately, followed your instructions to a T. Same thing. I have an entry that tomorrow that is still showing incorrectly.

          Little outta my depth, going to check the other cal modules to see if they parse the cal differently.

          The only other thing I can think of is my firm is US and I am based in the UK. Office 365 has my region set correctly to UK.

          1 Reply Last reply Reply Quote 0
          • S Offline
            shaneapowell @mlcampbe
            last edited by Jan 27, 2020, 3:29 PM

            @mlcampbe said in Calendar timezone problems:

            I’ve solved this problem by replacing the node-ical script that the default calendar modules uses with a fork of it.

            …

            Just wanted to say thanks… I had updated my MM recently, and my calendar TZ broke as a result (using multiple different google calendars). Quick google search and I found this post. The fix worked perfectly for me. All my events show the correct TZ corrected time now.

            1 Reply Last reply Reply Quote 0
            • R Offline
              Rosbif @mlcampbe
              last edited by May 22, 2020, 12:30 PM

              @mlcampbe Just found this whilst googling. The solution doesn’t work for me either. It’s a tad frustrating.

              I’ve tried with both a google calendar and O365 calendar and both produce the same results (UK time displayed whereas my timezone is Paris).

              1 Reply Last reply Reply Quote 0
              • B Offline
                BravoOscar @mlcampbe
                last edited by Jan 11, 2022, 7:42 PM

                @mlcampbe said in Calendar timezone problems:

                I’ve solved this problem by replacing the node-ical script that the default calendar modules uses with a fork of it.

                I did some research and found that the default calendar module uses the node-ical modules to parse calendar data. I notice that it is based off of https://github.com/peterbraden/ical.js. I also found https://github.com/jens-maus/node-ical that is based off of the original peterbraden/ical.js. but seems to have been updated to use the npm package moment-timezone.

                I did a drop in replacement and it seems to work:

                cd modules/default/calendar/vendor
                mv ical.js ical.js.orig
                git clone https://github.com/jens-maus/node-ical
                mv node-ical/ ical.js
                cd ical.js
                npm install

                Restarted MM and now my timezones are showing up properly. So I made my own modules out of this so it won’t get overwritten by updates.

                I have a problem with the google ical calendar format, its 1 hour off when its used in MMM-CalendarEXT2, but I think it has something to do with winter/summer time.
                Can the quote fix this problem?

                I can see in the folder " ~/MagicMirror/modules/MMM-CalendarExt2/node_modules " that there is a file called ical.js, but how to i update the file to the one in the qoute, so i can test if thats is the problem?

                My pi has timezone to Europe / Copenhagen, and the calender entry is ok when i look at my phones calender and also ok on the google calender.

                S 1 Reply Last reply Jan 11, 2022, 7:45 PM Reply Quote 0
                • S Away
                  sdetweil @BravoOscar
                  last edited by Jan 11, 2022, 7:45 PM

                  @bravooscar is the default calendar ok? I have done a lot of work to get that fixed over the last few releases…

                  calext2 is no longer maintained…

                  Sam

                  How to add modules

                  learning how to use browser developers window for css changes

                  B 1 Reply Last reply Jan 11, 2022, 9:22 PM Reply Quote 0
                  • B Offline
                    BravoOscar @sdetweil
                    last edited by Jan 11, 2022, 9:22 PM

                    @sdetweil Yes default calendar is ok,so it has to be CalendarEXT2 that has a problem, and it could be the ical.js from above that could help?

                    S 1 Reply Last reply Jan 11, 2022, 9:30 PM Reply Quote 0
                    • S Away
                      sdetweil @BravoOscar
                      last edited by Jan 11, 2022, 9:30 PM

                      @bravooscar sorry, no idea.

                      MM moved away from ical.js when it couldn’t handle some of the requirements from multiple calendar sources. even then I added a lot of code to handle tz and daylight savings shifts

                      Sam

                      How to add modules

                      learning how to use browser developers window for css changes

                      1 Reply Last reply Reply Quote 0
                      • 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