mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-28 12:12:20 +00:00
fix full date start time and duration, east of UTC, make getCorrection more understandable with variable name changes
This commit is contained in:
parent
469a90787b
commit
3a8587378c
@ -402,7 +402,7 @@ const CalendarFetcher = function (url, reloadInterval, excludedEvents, maximumEn
|
|||||||
// if this is a windows timezone
|
// if this is a windows timezone
|
||||||
if (event.start.tz.includes(" ")) {
|
if (event.start.tz.includes(" ")) {
|
||||||
// use the lookup table to get theIANA name as moment and date don't know MS timezones
|
// use the lookup table to get theIANA name as moment and date don't know MS timezones
|
||||||
let tz = getIanaTZFrostart_offset(event.start.tz);
|
let tz = getIanaTZFromMS(event.start.tz);
|
||||||
Log.debug("corrected TZ=" + tz);
|
Log.debug("corrected TZ=" + tz);
|
||||||
// watch out for unregistered windows timezone names
|
// watch out for unregistered windows timezone names
|
||||||
// if we had a successfule lookup
|
// if we had a successfule lookup
|
||||||
@ -421,7 +421,7 @@ const CalendarFetcher = function (url, reloadInterval, excludedEvents, maximumEn
|
|||||||
const regex = /[+|-]\d*:\d*/;
|
const regex = /[+|-]\d*:\d*/;
|
||||||
const start_offsetString = event.start.tz.match(regex).toString().split(":");
|
const start_offsetString = event.start.tz.match(regex).toString().split(":");
|
||||||
let start_offset = parseInt(start_offsetString[0]);
|
let start_offset = parseInt(start_offsetString[0]);
|
||||||
start_offset *= event.start.tz[1] == "-" ? -1 : 1;
|
start_offset *= event.start.tz[1] === "-" ? -1 : 1;
|
||||||
adjustHours = start_offset;
|
adjustHours = start_offset;
|
||||||
Log.debug("defined offset=" + start_offset + " hours");
|
Log.debug("defined offset=" + start_offset + " hours");
|
||||||
current_offset = start_offset;
|
current_offset = start_offset;
|
||||||
@ -483,7 +483,7 @@ const CalendarFetcher = function (url, reloadInterval, excludedEvents, maximumEn
|
|||||||
* lookup iana tz from windows
|
* lookup iana tz from windows
|
||||||
*/
|
*/
|
||||||
let zoneTable = null;
|
let zoneTable = null;
|
||||||
const getIanaTZFrostart_offset = function (msTZName) {
|
const getIanaTZFromMS = function (msTZName) {
|
||||||
if (!zoneTable) {
|
if (!zoneTable) {
|
||||||
const p = require("path");
|
const p = require("path");
|
||||||
zoneTable = require(p.join(__dirname, "windowsZones.json"));
|
zoneTable = require(p.join(__dirname, "windowsZones.json"));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user