Comments (3)
yes the rrule processor has trouble with some date combinations.
not our code. and we can't tell as we don't process the ics file in MagicMirror code
from magicmirror.
I did a little bit more digging and the extra day is added in calendarfetcherutils.js
around line 300:
// RRule can generate dates with an incorrect recurrence date. Process the array here and apply date correction.
if (hasByWeekdayRule) {
Log.debug("Rule has byweekday, checking for correction");
dates.forEach((date, index, arr) => {
// NOTE: getTimezoneOffset() is negative of the expected value. For America/Los_Angeles under DST (GMT-7),
// this value is +420. For Australia/Sydney under DST (GMT+11), this value is -660.
const tzOffset = date.getTimezoneOffset() / 60;
const hour = date.getHours();
if ((tzOffset < 0) && (hour < -tzOffset)) { // east of GMT
Log.debug(`East of GMT (tzOffset: ${tzOffset}) and hour=${hour} < ${-tzOffset}, Subtracting 1 day from ${date}`);
arr[index] = new Date(date.valueOf() - oneDayInMs);
} else if ((tzOffset > 0) && (hour >= (24 - tzOffset))) { // west of GMT
Log.debug(`West of GMT (tzOffset: ${tzOffset}) and hour=${hour} >= 24-${tzOffset}, Adding 1 day to ${date}`);
arr[index] = new Date(date.valueOf() + oneDayInMs);
}
});
if I’m not mistaken the time zone is set to null just before that code is executed. I think if calendar/event is matching the local time zone the adjustment shouldn’t be made. I tried to comment out the code above and it displays the date correctly, but of course it breaks some of the existing tests. I think that it needs additional checks before execution. Maybe checking that event timezone doesn’t match local timezone (although I didn’t dig into the code much yet)
thanks
from magicmirror.
that's my code trying to deal with this problem. no good fix yet
from magicmirror.
Related Issues (20)
- Crash on Start possibility HOT 8
- PR 2881 extended calendar to receive notifications from other modules, but code in wrong place
- [weather] openmeteo precipitationProbability not shown in forecast
- newsfeed enclosured picture feature HOT 6
- [weather] openmeteo hourly does not work into next day
- [weather] provider openmeteo showing nightly icons in forecast when current time is "nightly"
- Electron >= v30.x uses Node v20
- Compliments module special days config HOT 5
- OpenMeteo weather provider uses "apparent temperature" in forecast data instead of actual temperatures HOT 2
- Option to turn on/off monitor under certain conditions HOT 1
- [testing] local e2e-testing in docker container doesn't work anymore
- [updatenotification] use of this module creates pm2 daemon process(es) HOT 3
- fix e2e testcase startApplication() helper to accept run date/time like the electron helper with the same name does HOT 2
- [core] cleanup questions HOT 4
- H
- H HOT 1
- Multiple Instances of Node Helper running for a single module HOT 4
- [WARN] No /home/*user*/MagicMirror/js/../modules/MMM-Jast/MMM-Jast.js found for module: MMM-Jast HOT 2
- Custom Region Layouts - V2.28.0 breaks functionality HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from magicmirror.