X-Git-Url: https://code.delx.au/comingnext/blobdiff_plain/26bb4aec00dbaf0ae17fac41c8471d99a0b80d10..1e409f4b962c7083ecb0fb8ebdb0d00f2c821f03:/comingNext/index.html diff --git a/comingNext/index.html b/comingNext/index.html index cadf329..6ac4e42 100644 --- a/comingNext/index.html +++ b/comingNext/index.html @@ -17,6 +17,7 @@ .now { } .description { } .icon { } +.overdue {} @@ -35,6 +36,8 @@ var config = { tomorrowText: { Type: 'String', Default: getLocalizedText('settings.default.tomorrowText'), Value: getLocalizedText('settings.default.tomorrowText'),}, showNowAsText: { Type: 'Bool', Default: true, Value: true,}, nowText: { Type: 'String', Default: getLocalizedText('settings.default.nowText'), Value: getLocalizedText('settings.default.nowText'),}, + markOverdueTodos: { Type: 'Bool', Default: true, Value: true,}, + overdueText: {Type: 'String', Default: getLocalizedText('settings.default.overdueText'), Value: getLocalizedText('settings.default.overdueText'),}, dateSeparator: { Type: 'String', Default: getLocalizedText('settings.default.dateSeparator'), Value: getLocalizedText('settings.default.dateSeparator'),}, dateFormat: { Type: 'Enum', Default: 'auto', Value: 'auto', ValidValues: ['auto', 'DDMM', 'MMDD'],}, weekDayLength: { Type: 'Int', Default: 2, Value: 2,}, @@ -55,6 +58,7 @@ var config = { cssStyle_now: { Type: 'String', Default: 'color:#ff00ff', Value: 'color:#ff00ff',}, cssStyle_description: { Type: 'String', Default: '', Value: '',}, cssStyle_icon: { Type: 'String', Default: 'width:15px; height:15px', Value: 'width:15px; height:15px',}, + cssStyle_overdue: { Type: 'String', Default: 'color:#ffff00', Value: 'color:#ffff00',}, } @@ -63,7 +67,7 @@ var config = { // Nothing of interest from here on... //------------------------------------------------------- var panelNum = 0; // use 1 for second panel -var version = "1.25"; +var version = "1.26"; var versionURL = "http://comingnext.sourceforge.net/version.xml"; var calendarService = null; var cacheEntriesHtml = []; @@ -150,25 +154,28 @@ function error(message) document.getElementById("calendarList").innerHTML = 'Error: ' + message; } -function isToday(date) +function areDatesEqual(date1, date2) { - if (date.getDate() == now.getDate() && date.getMonth() == now.getMonth()) - return true; - return false; + return (date1.getFullYear() == date2.getFullYear() && + date1.getMonth() == date2.getMonth() && + date1.getDate() == date2.getDate()); } function isTomorrow(date) { - if ((date.getDate() == now.getDate() + 1 && date.getMonth() == now.getMonth()) || - (date.getDate() == 0 && date.getMonth() == now.getMonth() + 1) || - (date.getDate() == 0 && date.getMonth() == now.getMonth() + 1 && date.getYear() == now.getYear() + 1)) - return true; - return false; + // tommorow = now + 1 day + // ToDo: some days can be shorter as 24 hours(daylight saving change day) + return areDatesEqual(date, new Date (now.getTime() + 24*60*60*1000)); +} + +function isToday(date) +{ + return areDatesEqual(date, now); } function collectLocales() { - var tmpyear = ((panelNum == 0) ? 2000 : 2001); + var tmpyear = 2000 + panelNum; var month = 0; if (months_translated.length > 0) @@ -465,11 +472,28 @@ function updateData() var counter = 0; var entryDate = ''; var dateArr = []; - var entriesHtml = '
![]() | ';
@@ -585,7 +619,10 @@ function updateData()
var weekDay = date.toLocaleDateString().substr(0,config['weekDayLength'].Value);
var time = formatTime(date);
var dateStr = formatDate(date, entryDate);
- if (entry.Type == 'ToDo' || entry.Type == 'Anniversary' || entry.Type == 'DayEvent' || entry.Type == 'Reminder') {
+ if (entry.Type == 'ToDo' && overdue && config['markOverdueTodos'].Value) {
+ dateStr = '' + config['overdueText'].Value + '';
+ entriesHtml += '' + dateStr + ' '; + } else if (entry.Type == 'ToDo' || entry.Type == 'Anniversary' || entry.Type == 'DayEvent' || entry.Type == 'Reminder') { if ((isToday(date) || isTomorrow(date)) && config['showTodayAsText'].Value) // show weekday if the date string is not text. looks odd otherwise entriesHtml += ' | ' + dateStr + ' '; else |