]> code.delx.au - comingnext/blobdiff - comingNext/index.html
Workaround for Nokia firmware bug
[comingnext] / comingNext / index.html
index abc25fd051ae52d4f80860abf259cc9280bc65fb..812ae7f69e6984e039bfd4960b0b165c7f80db05 100644 (file)
@@ -34,6 +34,7 @@ var config = {
        fontsize: { Type: 'Enum', Default: 'auto', Value: 'auto', ValidValues: ['auto', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28'],},\r
        eventsPerWidget: { Type: 'Int', Default: 4, Value: 4,},\r
        monthRange: { Type: 'Int', Default: 2, Value: 2,},\r
+       maxNumberOfEventsOnFullscreen: { Type: 'Int', Default: 30, Value: 30,},\r
        includeTodos: { Type: 'Bool', Default: true, Value: true,},\r
        useBackgroundImage: { Type: 'Bool', Default: true, Value: true,},\r
        backgroundImageLocation: { Type: 'Enum', Default: 'internal', Value: 'internal', ValidValues: ['internal', 'external']},\r
@@ -112,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\r
 var timeFormatSeparator = ":"; // format time 19:00 or 19.00 depending on system setting\r
 var defaultFontSize = null; // default browser font size will be set by init\r
+var displayOffset = 0;\r
 \r
 // vars for daylight saving time\r
 var summertime = false; // true, if current date is in summer, false if in winter\r
@@ -530,6 +532,9 @@ function parseDate(dateString)
                        log('parseDate(): fixing time +1h: ' + result);\r
                }\r
        }\r
+       if (displayOffset != 0) {\r
+               result = new Date(result.getTime() + displayOffset);\r
+       }\r
 \r
        return result;\r
 }\r
@@ -758,7 +763,7 @@ function updateData()
                if (mode == 0)\r
                        max = (panelNum + 1) * config['eventsPerWidget'].Value;\r
                else\r
-                       max = 30; // we can display a lot more events in fullscreen mode\r
+                       max = config["maxNumberOfEventsOnFullscreen"].Value; // we can display a lot more events in fullscreen mode\r
 \r
                if (config['enableLogging'].Value) {\r
                        var listinfo = "";\r
@@ -1042,6 +1047,7 @@ function init()
        else {\r
                mode = 1;\r
        }\r
+       checkForOffByOneBug();\r
        log("init(): updateScreen()");\r
        updateScreen();\r
        if (config['useBackgroundImage'].Value)\r
@@ -1056,6 +1062,17 @@ function init()
                statupSuccessful = true;\r
 }\r
 \r
+function checkForOffByOneBug() {\r
+       var tz = new Date().getTimezoneOffset();\r
+       if (tz < 0) {\r
+               tz = -tz;\r
+       }\r
+       tz = tz / 60;\r
+       if (tz > 12) {\r
+               displayOffset = 24*3600*1000;\r
+       }\r
+}\r
+\r
 function checkOrientation()\r
 {\r
        //updateScreen();\r