X-Git-Url: https://code.delx.au/comingnext/blobdiff_plain/c6d28755aa280795cfa8a12285f929d40e475e1c..19eb00692717db01ea65d25bd4a8c0f1eb1ec5f7:/comingNext/index.html diff --git a/comingNext/index.html b/comingNext/index.html index abc25fd..1d45580 100644 --- a/comingNext/index.html +++ b/comingNext/index.html @@ -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'],}, eventsPerWidget: { Type: 'Int', Default: 4, Value: 4,}, monthRange: { Type: 'Int', Default: 2, Value: 2,}, + maxNumberOfEventsOnFullscreen: { Type: 'Int', Default: 30, Value: 30,}, includeTodos: { Type: 'Bool', Default: true, Value: true,}, useBackgroundImage: { Type: 'Bool', Default: true, Value: true,}, backgroundImageLocation: { Type: 'Enum', Default: 'internal', Value: 'internal', ValidValues: ['internal', 'external']}, @@ -85,6 +86,18 @@ var config = { //------------------------------------------------------- // Nothing of interest from here on... //------------------------------------------------------- + +function fixDate(d) { + if (d.getTimezoneOffset() < -12*60) { + d = new Date((new Date(d.getTime()-24*3600*1000)).toLocaleString()); + } + return d +} + +function newDate() { + return fixDate(new Date()); +} + var panelNum = 0; // use 1 for second panel var version = "1.37"; var versionURL = "http://comingnext.sourceforge.net/version.xml"; @@ -93,7 +106,7 @@ var cacheEntriesHtml = []; var months_translated = []; var weekdays_translated = []; var orientation = ''; -var now = new Date(); +var now = newDate(); var mode = 0; // 0 = homescreen, 1 = fullscreen, 2 = settings, 3 = about, 4 = check for update var reqV = null; var settingsCalEntryId = null; @@ -254,7 +267,7 @@ function collectLocales() } } for (weekday = 0; weekday < 7; weekday++) { - var startDate = new Date(2000, 0, 2 + weekday); // date that we know for sure is a sunday + var startDate = new Date(2000, 0, 2 + weekday, 12); // date that we know for sure is a sunday var item = new Object(); item.Type = "DayEvent"; @@ -667,7 +680,7 @@ function updateData() lastReloadTime = null; // force calendar data reload on this update } - now = new Date(); + now = newDate(); // only reload calendar data every 6 hours, visual updates occure more often if (!lastReloadTime || now.getTime() - lastReloadTime.getTime() > reloadInterval) { @@ -725,7 +738,7 @@ function updateData() } else { entryLists = [meetingList]; } - lastReloadTime = new Date(); + lastReloadTime = newDate(); } catch(e) { error('loading Calendar items list:' + e + ', line ' + e.line); return; @@ -758,7 +771,7 @@ function updateData() if (mode == 0) max = (panelNum + 1) * config['eventsPerWidget'].Value; else - max = 30; // we can display a lot more events in fullscreen mode + max = config["maxNumberOfEventsOnFullscreen"].Value; // we can display a lot more events in fullscreen mode if (config['enableLogging'].Value) { var listinfo = ""; @@ -952,7 +965,7 @@ function updateData() cacheEntriesHtml = entriesHtml; } - lastUpdateTime = new Date(); + lastUpdateTime = newDate(); } catch(e) { error('displaying list:' + e + ', line ' + e.line); return; @@ -992,7 +1005,7 @@ function handleOnShow() { updateScreen(); - var time = new Date(); + var time = newDate(); if (time.getTime() - lastUpdateTime.getTime() > config['updateDataInterval'].Value * 60 * 1000) { log('updateScreen(): force updateData() because last update was too long ago (' + (time.getTime() - lastUpdateTime.getTime()) / 1000 + 's)'); clearUpdateTimer();