mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-08-21 12:55:22 +00:00
[Fix] start time of calendar event gets corrected by time zone offset.
This commit is contained in:
@@ -332,8 +332,10 @@ const CalendarUtils = {
|
|||||||
Log.debug("Fullday");
|
Log.debug("Fullday");
|
||||||
// If the offset is negative (east of GMT), where the problem is
|
// If the offset is negative (east of GMT), where the problem is
|
||||||
if (dateoffset < 0) {
|
if (dateoffset < 0) {
|
||||||
// If the date hour is less than the offset
|
// Remove the offset, independently of the comparison between the date hour and the offset,
|
||||||
if (dh < Math.abs(dateoffset / 60)) {
|
// since in the case that *date houre < offset*, the *new Date* command will handle this by
|
||||||
|
// representing the day before.
|
||||||
|
|
||||||
// Reduce the time by the offset:
|
// Reduce the time by the offset:
|
||||||
// Apply the correction to the date/time to get it UTC relative
|
// Apply the correction to the date/time to get it UTC relative
|
||||||
date = new Date(date.getTime() - Math.abs(nowOffset) * 60000);
|
date = new Date(date.getTime() - Math.abs(nowOffset) * 60000);
|
||||||
@@ -341,7 +343,6 @@ const CalendarUtils = {
|
|||||||
// fix it for this event entry
|
// fix it for this event entry
|
||||||
//duration = 24 * 60 * 60 * 1000;
|
//duration = 24 * 60 * 60 * 1000;
|
||||||
Log.debug("new recurring date1 is " + date);
|
Log.debug("new recurring date1 is " + date);
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
// if the timezones are the same, correct date if needed
|
// if the timezones are the same, correct date if needed
|
||||||
if (event.start.tz === moment.tz.guess()) {
|
if (event.start.tz === moment.tz.guess()) {
|
||||||
|
Reference in New Issue
Block a user