daylightSavingOffset: { Type: 'Int', Default: 1, Value: 1,},\r
hideWidgetOnCalendarOpen: { Type: 'Bool', Default: false, Value: false,},\r
showCalendarIndicator: { Type: 'Bool', Default: true, Value: true,},\r
- excludedCalendars: { Type: 'Array', Default: '', Value: '',},\r
+ excludedCalendars: { Type: 'Array', Default: [], Value: [],},\r
cssStyle_background: { Type: 'String', Default: 'color:#ffffff; background-color:#000000', Value: 'color:#ffffff; background-color:#000000',},\r
cssStyle_backgroundFullscreen: { Type: 'String', Default: 'color:#ffffff; background-color:#000000', Value: 'color:#ffffff; background-color:#000000',},\r
cssStyle_weekDay: { Type: 'String', Default: '', Value: '',},\r
var calendarColors = [];\r
var updateTimer = null;\r
var screenRotationTimer = null;\r
+var lastUpdateTime = now;\r
\r
// vars for daylight saving time\r
var summertime = false; // true, if current date is in summer, false if in winter\r
document.getElementById('fullscreenCalendarList').innerHTML = entriesHtml;\r
cacheEntriesHtml = entriesHtml;\r
}\r
+ \r
+ lastUpdateTime = new Date();\r
} catch(e) {\r
error('displaying list:' + e + ', line ' + e.line);\r
return;\r
updateHomescreen();\r
else if (mode == 1)\r
updateFullscreen();\r
+ \r
+ var time = new Date();\r
+ if (time.getTime() - lastUpdateTime.getTime() > config['updateDataInterval'].Value * 60 * 1000) {\r
+ console.info('updateScreen(): force updateData() because last update was too long ago (' + (time.getTime() - lastUpdateTime.getTime()) / 1000 + 's)');\r
+ clearUpdateTimer();\r
+ updateData();\r
+ setUpdateTimer(); // reinitialize update timer\r
+ }\r
}\r
\r
function launchCalendar()\r
config[key].Value = value;\r
else if (config[key].Type == 'UID')\r
config[key].Value = Number(value);\r
- else if (config[key].Type == 'Array')\r
+ else if (config[key].Type == 'Array') {\r
config[key].Value = value.split("^");\r
+ if (config[key].Value.length == 1 && config[key].Value[0] == "") {\r
+ config[key].Value = [];\r
+ }\r
+ }\r
}\r
settingsCache = entry.Summary;\r
updateCssClasses();\r
}\r
}\r
}\r
+ // NOTE: events my have no date information at all. In that case, we list events without date first\r
+ else if (atime && !btime) {\r
+ return 1;\r
+ }\r
+ else if (!atime && btime) {\r
+ return -1;\r
+ }\r
+ else if (!atime && !btime) {\r
+ // sort by type\r
+ if (a.Type != b.Type) {\r
+ if (a.Type < b.Type) {\r
+ return -1;\r
+ }\r
+ else if (a.Type > b.Type) {\r
+ return 1;\r
+ }\r
+ }\r
+ // sort by description\r
+ else if (a.Summary && b.Summary && a.Summary != b.Summary) {\r
+ if (a.Summary < b.Summary) {\r
+ return -1;\r
+ }\r
+ else if (a.Summary > b.Summary) {\r
+ return 1;\r
+ }\r
+ }\r
+ }\r
\r
return 0;\r
}\r