Read the statement by Michael Teeuw here.
Trouble with calendar.js
-
Hi:
After the update to the current version failed at the weekend, I have completely reinstalled my MagicMirror². This has also worked in principle. However, the calendar module now always shows me absolute timeFormat. This was not the case before and I cannot change it. The setting [timeFormat: “relative”] does not work. Even with the unedited config.js.sample this behavior shows up.
I replaced the “calendar.js” with the previous version, so the display works as desired. Only I am not release able with it.Does anyone have an idea?
-
@mmm-kludo can u show the config.js entry for calendar
you can xx out the url so it doesn’t work
{ module: 'calendar', ... config:{ .... } } -
@sdetweil The URL works, the display of the timeFormat is incorrect!
-
@mmm-kludo not my point. I want to see the config entry for calendar and do NOT want others to see your working calendar url
-
@sdetweil Sorry, I must have misunderstood. For me, the behavior that no relative times are displayed already after the Installtion. Without that I have made changes in the configfile. Although the default setting is “relative”.
All attempts on my part failed, except replacing the calendar.js.RaspOS version: more 5.10.63-v7l+
Mirror version: “2.17.1” -
@mmm-kludo again, you haven’t provided the config.js section for the calendar.
I want to see the exact text
-
@sdetweil I have not changed anything, the exact text is:
{ module: "calendar", header: "US Holidays", position: "top_left", config: { calendars: [ { symbol: "calendar-check", url: "webcal://www.calendarlabs.com/ical-calendar/ics/76/US_Holidays.ics" } ] } },and on the mirror I see this:
Christmas Saturday at 00:00 New Year's Day Jan 1stbut I would like, for example, this:
Help me Today Christmas Tomorrow New Year's Day in 5 Days -
@mmm-kludo ok, you say timeFormat: doesn’t work but u haven’t specified it in the config
ALL config for ANY module goes in config.js
{ module: "calendar", header: "US Holidays", position: "top_left", config: { timeFormat: "relative", ... whatever other parms calendars: [ { symbol: "calendar-check", url: "webcal://www.calendarlabs.com/ical-calendar/ics/76/US_Holidays.ics" } ] } },you NEVER change the source code itself…
config info for cal
https://docs.magicmirror.builders/modules/calendar.htmlnote the getRelative parm …
calendar has too many options (in my opinion),
-
@sdetweil Thank you for your help. I have changed the value as you recommended. According to my understanding, this setting is also the default value. However, my display has not changed.
-
note the getRelative parm …
how far in front of the event does the thing change to relative? in HOURS
xmas is 4 DAYS (48 hours), default is 6 (HOURS)
-
@sdetweil When I do this, the appointments for the 2 next days are displayed as desired. Previously it was possible that all appointments were displayed in this form. This now seems to no longer work.
Thanks again for your support, I had a wrong thinking due to my simpler previous version.
-
@sdetweil I was wrong, it still does not work as before. I am always shown absolute times (e.g. Sunday, Monday, …) and no relative ones (e.g. Today, Tomorrow, …).
{ module: "calendar", header: "Termine", position: "top_left", config: { timeFormat: "relative", getRelative: 48, nextDaysRelative: true, hideTime: true, calendars: [ { symbol: "calendar-check", -
@mmm-kludo can u compare the defaults section of your old calendar.js with the current one?
I assume u made changes to it originally
-
@sdetweil I compared the two versions (current and spring 2020) with NotePadd++ Compare and found no significant differences in the default section. Of course, the newer version has additional fields due to functional enhancements (limitDays, hideTime, customEvents).

Significant differences in the code can be seen in the middle of the code between lines 350 and 500. In this area the old version has additional lines which are not included in the current code.

Due to lack of programming knowledge, I do not think that I have made changes in the code.
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