Read the statement by Michael Teeuw here.
"absolute" does not mean absolute in default calendar module
-
Hi,
As I am affected by the time offset bug in master I have tried the latest development version of MagicMirror.There is a bug in the display logic in calendar.js. I want to display the date/time in absolute format, i.e. never change to relative. I have getRelative=0 and urgency=0 in my config. Even so, the display is wrong.
For Full Day Events it always shows “today”, “tomorrow” or “dayaftertomorrow” even if timeFormat=absolute. There seems to be a condition missing in calendar.js that takes timeFormat into account for full day events.
For normal events the display changes to “Ends in xx minutes” for ongoing events. Looking at the code it looks like the condition on line 328 always is true regardless of timeFormat.
How should I configure the module to ALWAYS use absolute as the format, i.e. under no circumstances change to relative?
-
@Alvinger you can change the timeFormat
-
@Alvinger also, as I am the one trying to fix calendar, I am interested in the offset problem.
new fixes were released on Monday, do if u got the develop branch before then, do another git pull to update it.
note: u need anothernpm installto update the node-ical library
if this doesn’t resolve your problem. I would love to see an event from your ics file. it is just text so I can copy/paste an entry here,
begin vevent
to
end vevent -
@sdetweil the latest development version solved the offset problem for me. As far as the “absolute” problem I rewrote the relevant section of calendar.js. As I have already forked MagicMirror to make it run on my IOS 9.3.5 Ipads I can’t submit a PR (at least I don’t know exactly how to do that) but would be happy to send you the calendar.js file.
There is still a problem with full day recurring events.
I can PM you a link to a relevant public (but inofficial) calendar with the issues.
-
@Alvinger ok. the latest fixes, Monday did address full day recurring
I would be happy to see the cal
-
Absolute isn’t absolute, without other tags…
getRelative and urgency also need to be set.
// Force Absolute to Absolute all the time, michmich *really* hates solid dates, apparently. timeformat: "absolute", getRelative: 0, urgency: 0 , -
This post is deleted! -
@hango correct, that’s all I did. But I changed it in all MM files. If I just knew exactly which files are executed in the browser I could have changed just those. As the iPads require a server (which can handle the latest ES) one only needs to change the browser-executed files.
-
@BKeyport well almost! I have this exact config but running events are still changed to “ends in xx min”! And all day events still shows as “today”
I’ve done a rewrite of the relevant section of calendar.js but can’t use my github clone repo to make a PR.
-
@Alvinger u needed to.make a fork, and then clone that. fork button is upper right
-
@sdetweil I know. But I have already forked the MM master and made changes to use my Ipad 2. How do I make a new branch containing the latest MM development files? My plan was to wait until the new version was merged into Master and then do my Ipad2-related changes. Github won’t allow me to have multiple repositories with the same name.
-
@sdetweil I have created a PR for the proposed calendar changes.
-
@Alvinger what branch did u use when u made your changes?
-
@hango I just checked the development branch of MM and changed the following files. It now works perfectly on my Ipad2. Of course, if you use non-default modules you may have to edit them as well.
- modified: js/electron.js
- modified: js/translator.js
- modified: modules/default/alert/alert.js
- modified: modules/default/alert/notificationFx.js
- modified: modules/default/calendar/calendar.js
- modified: modules/default/compliments/compliments.js
- modified: modules/default/newsfeed/newsfeed.js
- modified: modules/default/updatenotification/updatenotification.js
- modified: modules/default/weather/weather.js
- modified: modules/default/weather/weatherobject.js
- modified: modules/default/weatherforecast/weatherforecast.js
The changes I made to the above files are:
- Changed all “let” to “var”.
- Changed all “() =>” to “function ()”. Also, you have to make sure that the expression following “function ()” is enclosed in curly braces “{}”, i.e. no one-liners!
-
@Alvinger That’s the one relative time I can agree with, honestly. Give me a timer so I can kick people out of my office… 🤣🤣
-
@sdetweil I used develop-hidden-module-update-restriction as that was the one with relevant changes for me
-
@Alvinger then u can change back to master, and create another branch from there
git checkout master git checkout -b new_name -
This post is deleted! -
@hango Okay, I thought electron.js was executed in the browser. But that’s one less file to edit. Also, there were no references to this within the => constructs that I could find.
-
@Alvinger the arrow function () =>{} , makes the use of ‘this’ not needed, because the context is not lost.
use of function(){} does change ‘this’
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