From: James Bunton Date: Fri, 5 Oct 2012 11:43:01 +0000 (+1000) Subject: Workaround for Nokia firmware bug X-Git-Url: https://code.delx.au/comingnext/commitdiff_plain/59b781af1f1c364dcf85c0ca1032998945b9433e Workaround for Nokia firmware bug --- diff --git a/comingNext/index.html b/comingNext/index.html index a11e029..812ae7f 100644 --- a/comingNext/index.html +++ b/comingNext/index.html @@ -113,6 +113,7 @@ var statupSuccessful = false; // indicates if everything started up wihtout erro var use12hoursTimeFormat = false; // defines how time should be formated: 19:00 or 07:00 pm var timeFormatSeparator = ":"; // format time 19:00 or 19.00 depending on system setting var defaultFontSize = null; // default browser font size will be set by init +var displayOffset = 0; // vars for daylight saving time var summertime = false; // true, if current date is in summer, false if in winter @@ -531,6 +532,9 @@ function parseDate(dateString) log('parseDate(): fixing time +1h: ' + result); } } + if (displayOffset != 0) { + result = new Date(result.getTime() + displayOffset); + } return result; } @@ -1043,6 +1047,7 @@ function init() else { mode = 1; } + checkForOffByOneBug(); log("init(): updateScreen()"); updateScreen(); if (config['useBackgroundImage'].Value) @@ -1057,6 +1062,17 @@ function init() statupSuccessful = true; } +function checkForOffByOneBug() { + var tz = new Date().getTimezoneOffset(); + if (tz < 0) { + tz = -tz; + } + tz = tz / 60; + if (tz > 12) { + displayOffset = 24*3600*1000; + } +} + function checkOrientation() { //updateScreen();