MagicMirror² v2.5.0 is available! For more information about this release, check out this topic.

MMM-MyCalendar: Showing wrong dates (days one day in the past)?



  • Hey there!

    For some time now, i have the following issue:

    My MMM-MyCalendar is showing dates wrongly (one day in the past) although they are correct in the used ics-file.

    Like this -> Halloween in the mirror-calender is the 30th (see red box in screenshot below) and in my ics-file - the start date - is the 31th (see second red box)

    0_1540212730779_pic.png

    (my pi system date/time is correct and i already updated the module - manually because i am on Mirror Version 2.1.0 - to MMM-MyCalendar version 1.0 -> from here: https://github.com/jclarke0000/MMM-MyCalendar/releases/tag/v1.0)

    Other devices also using this (from my NAS provided) ics-file (like my mobile phone) displaying the dates correct (also Halloween on the 31th)

    Where can i fix this one day error/difference in the MMM-MyCalendar module?

    I got some interesting (extracted with “pm2 log --lines 100”) logfiles:

    0_1540308657056_Bildschirmfoto vom 2018-10-23 17:28:53.png

    0_1540308667913_Bildschirmfoto vom 2018-10-23 17:29:19.png

    0_1540308676464_Bildschirmfoto vom 2018-10-23 17:30:11.png

    The last screenshot of the log is interesting:

    … Cannot read property "length’ of undefined at eventDate (/…/calendarfetcher.js)…

    Maybe this is the key to my mystery?

    Again: Where can i fix this one day error/difference in the MMM-MyCalendar module?


  • Module Developer

    @medo Do you have the same issue using the default calendar module? My module uses the same fetching mechanism behind the scenes as the default calendar module. It’s only a different display style.



  • @j-e-f-f said in MMM-MyCalendar: Showing wrong dates (days one day in the past)?:

    @medo Do you have the same issue using the default calendar module? My module uses the same fetching mechanism behind the scenes as the default calendar module. It’s only a different display style.

    Yes, with standard calendar module the same issues occur…



  • had the same issue, it shows you the end of the event, usually because its an all day event.
    here is my config:
    just added the option showEnd: false
    and date and time formats according to moments.js

     module: "calendar",
                            header: "Calendar",
                            position: "top_center",
                            config: {
                                    maximumEntries: 10,
                                    maximumNumberOfDays: 32,
                                    dateFormat: 'D MMMM - H:mm',
                                    fullDayEventDateFormat: 'D MMMM',
                                    timeFormat: 'absolute',
                                    showEnd: false,
                                    urgency: 0,
                                    getRelative: 0,
                                    calendars: [
    etc...
    


  • @detto65 said in MMM-MyCalendar: Showing wrong dates (days one day in the past)?:

    had the same issue, it shows you the end of the event, usually because its an all day event.

    Thanks detto65! I tried your suggestions for the code changes…
    As i do not have a wrong date in my calendar list at the moment, i will report if the changes solved my problem (when or if a wrong date appears or not).

    But i do have a last question:

    I added “showEnd: false”, but left in my configuration these two entries untouched: "timeFormat: “HH:mm [Uhr]” and "dateFormat: “dddd” (as these two entries suit my needs a little bit better).

    Is the entry “showEnd: false” enough to solve my problem or do i have to alter the both stated above (time and dateFormat) also - according to your alterations? What do you think?



  • @medo showEnd:false should do the trick,
    i only used de dateformats to show the dates in a more readable format.



  • I am having a similar but yet different issue.
    I noticed that one of my several calendars was showing activities one day early. I added new events for testing, and they show on the correct day, but the old events show a day off still.

    The green events come from the same calendar. The test events show on the right date in MM, but you can see that the Daycare event shows on the wrong date. I tried the no end “fix”, but that didn’t fix things. I checked my Pi and the calendar timezones and locations, and they all match (US, EN, Chicago). Are the events cached and can the cache be cleared? Any other debugging options that I can be helped with?

    0_1541340795690_GCal - Right dates.JPG

    0_1541340799163_MM - Wrong dates.JPG

    Everything worked fine up until a day or two ago, and I’m not sure what changed.

    Thank you in advance for the help.



  • I think I fixed my issue. I decided to start over (saved my config.js, but wiped everything else), and noticed things seemed fine, except for one calendar. I changed the ordinal date as others have recommended to fix the issue with events earlier than 1970, and saw the issue come back. I changed the date back to 1970, and the issue went away. So ultimately I deleted all calendar items from before 1970 to fix my issue.



  • I have a similar problem. My calender seems to be broken. Holidays and my own appointments where displayed 2-3 days earlier. I dont know how to solve this problem.