Read the statement by Michael Teeuw here.
Calendar events showing on wrong day.
-
Hey @sdetweil, I am experiencing the same issue and made the changes as you motioned, but now I am getting an error for the calendar module, and the module is not loaded, if I revert the module loads and work as expected, any ideas?
Config Change
} else { // if the timezones are the same, correct date if needed // if (event.start.tz === moment.tz.guess()) { // if the date hour is less than the offset if (24 - dh < Math.abs(dateoffset / 60)) { // apply the correction to the date/time back to right day date = new Date(date.getTime() + Math.abs(24 * 60) * 60000); // the duration was calculated way back at the top before we could correct the start time.. // fix it for this event entry //duration = 24 * 60 * 60 * 1000; Log.debug("new recurring date2 is " + date); } // } } } else { // not full day, but luxon can still screw up the date on the rule processing // we need to correct the date to get back to the right event for if (dateoffset < 0) { // if the date hour is less than the offset if (dh < Math.abs(dateoffset / 60)) { // Reduce the time by the offset: // Apply the correction to the date/time to get it UTC relative date = new Date(date.getTime() - Math.abs(nowOffset) * 60000); // the duration was calculated way back at the top before we could correct the start time.. // fix it for this event entry //duration = 24 * 60 * 60 * 1000; Log.debug("new recurring date1 is " + date); } } else { // if the timezones are the same, correct date if needed // if (event.start.tz === moment.tz.guess()) { // if the date hour is less than the offset if (24 - dh < Math.abs(dateoffset / 60)) { // apply the correction to the date/time back to right day date = new Date(date.getTime() + Math.abs(24 * 60) * 60000); // the duration was calculated way back at the top before we could correct the start time.. // fix it for this event entry //duration = 24 * 60 * 60 * 1000; Log.debug("new recurring date2 is " + date); } // } } } startDate = moment(date);
-
@coolie1101 said in Calendar events showing on wrong day.:
Config Change
you don’t change config, you are changing the module source code, right?
4 lines in 1 file
-
@sdetweil Yes, \modules\default\calendar\calendarutils.js
I forgot to post the event in my previous post, see below.
BEGIN:VEVENT DTSTART:20191113T100000Z DTEND:20191113T150000Z DTSTAMP:20211119T124216Z UID:6h0hrr7t2gr6qopi**********@google.com RECURRENCE-ID:20191112T100000Z CREATED:20211026T075843Z DESCRIPTION: LAST-MODIFIED:20211026T080254Z LOCATION: SEQUENCE:1 STATUS:CONFIRMED SUMMARY:YARD WASTE TRANSP:OPAQUE END:VEVENT
-
@coolie1101 can us show me the messages where u start MM? (after doing the edit)
should include stuff like this
[18.11.2021 15:15.55.588] [LOG] Connecting socket for: updatenotification [18.11.2021 15:15.55.588] [LOG] Connecting socket for: calendar [18.11.2021 15:15.55.588] [LOG] Starting node helper for: calendar [18.11.2021 15:15.55.588] [LOG] Connecting socket for: newsfeed [18.11.2021 15:15.55.588] [LOG] Starting node helper for: newsfeed [18.11.2021 15:15.55.588] [LOG] Connecting socket for: MMM-Config [18.11.2021 15:15.55.588] [LOG] Starting module helper: MMM-Config [18.11.2021 15:15.55.588] [LOG] Sockets connected & modules started ... [18.11.2021 15:15.55.665] [LOG] Launching application. [18.11.2021 15:15.59.955] [LOG] Create new calendarfetcher for url: http://localhost:8090/modules/default/calendar/canada.ics - Interval: 300000 [18.11.2021 15:15.59.964] [LOG] Create new newsfetcher for url: https://rss.nytimes.com/services/xml/rss/nyt/HomePage.xml - Interval: 300000
(if using pm2, stop instance first, pm2 stop all)
npm start >somefile.txtthen ctrl-c after MM shows cal info (if any, or error)
then examine somefile.txt
-
@coolie1101 do you have the current version of the vevent? as that one expired in 2019, and has no repeating rule
but when I adjusted to this year and nov 21
BEGIN:VEVENT DTSTART:20211121T100000Z DTEND:20211121T150000Z DTSTAMP:20211119T124216Z UID:6h0hrr7t2gr6qopifribble@google.com RECURRENCE-ID:20191112T100000Z CREATED:20211026T075843Z DESCRIPTION: LAST-MODIFIED:20211026T080254Z LOCATION: SEQUENCE:1 STATUS:CONFIRMED SUMMARY:YARD WASTE TRANSP:OPAQUE END:VEVENT
i see the right display
[19.11.2021 07:40.05.433] [DEBUG] startDate (local): Sun Nov 21 2021 04:00:00 GMT-0600 (Central Standard Time) [19.11.2021 07:40.05.433] [DEBUG] endDate (local): Sun Nov 21 2021 09:00:00 GMT-0600 (Central Standard Time)
as there is no timezone associated with that time. and I am CST
-
@sdetweil Yes, see below.
BEGIN:VEVENT DTSTART;TZID=America/New_York:20210406T050000 DTEND;TZID=America/New_York:20210406T100000 RRULE:FREQ=WEEKLY;WKST=SU;UNTIL=20211230T045959Z;BYDAY=TU DTSTAMP:20211119T124216Z UID:0v89h5cit8nq6m************@google.com CREATED:20211026T075843Z DESCRIPTION: LAST-MODIFIED:20211026T080254Z LOCATION: SEQUENCE:1 STATUS:CONFIRMED SUMMARY:YARD WASTE TRANSP:OPAQUE END:VEVENT
I can share that calendar with you if it makes it easier for you to test.
-
@coolie1101 said in Calendar events showing on wrong day.:
I can share that calendar with you if it makes it easier for you to test.
no, i just create an ics file… easy cut/paste
-
@sdetweil said in Calendar events showing on wrong day.:
npm start >somefile.txt
What is this suppose to do?, seems something is missing from the command.
-
@coolie1101 it directs the output of the command (npm start) to a file (somefile.txt)
this is normal file output redirection, same as on windows
the normal MM startup output looks like this
> magicmirror@2.17.1 start /home/sam/MagicMirror > DISPLAY="${DISPLAY:=:0}" ./node_modules/.bin/electron js/electron.js [19.11.2021 07:50.19.980] [LOG] Starting MagicMirror: v2.17.1 [19.11.2021 07:50.19.981] [LOG] Loading config ... [19.11.2021 07:50.19.982] [LOG] Loading module helpers ... [19.11.2021 07:50.19.982] [LOG] trying to load module=alert [19.11.2021 07:50.19.982] [LOG] No helper found for module: alert. [19.11.2021 07:50.19.982] [LOG] trying to load module=MMM-Tools [19.11.2021 07:50.19.999] [LOG] Initializing new module helper ... [19.11.2021 07:50.19.999] [LOG] Module helper loaded: MMM-Tools [19.11.2021 07:50.19.999] [LOG] trying to load module=updatenotification [19.11.2021 07:50.20.000] [LOG] Initializing new module helper ... [19.11.2021 07:50.20.000] [LOG] Module helper loaded: updatenotification [19.11.2021 07:50.20.000] [LOG] trying to load module=clock
etc
-
@coolie1101 after copying your new cal entry to ics, and running… it looks good to me…
(with the edited calendarutils.js) (I am central US time)this ics with the other persons info in too