-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Issue #1798 - fixing recurrent calendar events crosstime DST #1884
fix: Issue #1798 - fixing recurrent calendar events crosstime DST #1884
Conversation
…MagicMirror into fix-timeshift-calendar
@@ -26,6 +26,17 @@ exports.parseFile = function(filename){ | |||
|
|||
var rrule = require('rrule').RRule | |||
|
|||
function getLocaleISOString(date) { | |||
var year = date.getFullYear().toString(10).padStart(4,'0'); | |||
var month = date.getMonth().toString(10).padStart(2,'0'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getMonth() returns a month between 0 and 11, not between 1 and 12 so this creates an invalid date.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the catch. I just put up PR #1914 to address this.
Issue #1798 - converting to Local times for JS Date Objects before submitting to 'rrule' library. Issue appears to be in
Rrule.between()
function where date and time are broken apart and then put back together, it looses reference to timezone with the UTC time passed.Fix - trick the function to thinking local time is UTC time and then convert back to UTC time after array of recurring events is returned.
Files impacted
Example:
Additional changes - Ran lint and inadvertently changed 8 other files.