X-Git-Url: https://code.delx.au/comingnext/blobdiff_plain/fc0b438fbfc9775eeb4af686488cee9459201fe1..3afbd64094ade75db55b442b626ff30448d389a8:/comingNextB/index.html diff --git a/comingNextB/index.html b/comingNextB/index.html index 18d334d..953bd10 100644 --- a/comingNextB/index.html +++ b/comingNextB/index.html @@ -14,6 +14,7 @@ here you can customize background color, font color, font size etc... .weekDay { } /* Defines the appearance of all week day texts */ .date { } /* Defines the appearance of all date texts */ .today { color:#ff0000; } /* Defines the appearance of "Today" text */ +.tomorrow { color:#0000ff; } /* Defines the appearance of "Tomorrow" text */ .time { } /* Defines the appearance of all time texts */ .now { color:#ff00ff; } /* Defines the appearance of "Now" text */ .description { } /* Defines the appearance of all event descriptions */ @@ -32,6 +33,7 @@ var showCombinedDateTime = false;// only show the time for events happening toda var showLocation = true; // show the location for meeting events var showTodayAsText = true; // if enabled, the current date will be shown as "Today" instead of "31.12" var todayText = 'Today'; // text to display for "Today" +var tomorrowText = 'Tomorrow'; // text to display for "Tomorrow" var showNowAsText = true; // if enabled, the appointment time will be shown as "Now" instead of "12:00" var nowText = 'Now'; // text to display for "Now" var dateSeparator = '.'; // separator for dates. e.g. "31.12" or "31/12" @@ -138,6 +140,15 @@ function isToday(date) return false; } +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; +} + function collectLocales() { var tmpyear = ((panelNum == 0) ? 2000 : 2001); @@ -332,6 +343,8 @@ function formatDate(date, format) if (showTodayAsText && isToday(date)) return '' + todayText + ''; + if (showTodayAsText && isTomorrow(date)) + return '' + tomorrowText + ''; var dateArr = format.replace(/,/g,'').replace(/\./g,':').replace(/ /g,' ').split(' '); if (dateArr.length != 5 && dateArr.length != 6) { @@ -549,18 +562,18 @@ function updateData() var time = formatTime(date); var dateStr = formatDate(date, entryDate); if (entry.Type == 'ToDo' || entry.Type == 'Anniversary' || entry.Type == 'DayEvent' || entry.Type == 'Reminder') { - if (isToday(date) && showTodayAsText) // show weekday if the date string is not text. looks odd otherwise + if ((isToday(date) || isTomorrow(date)) && showTodayAsText) // show weekday if the date string is not text. looks odd otherwise entriesHtml += '' + dateStr + ' '; else entriesHtml += '' + weekDay + '' + dateStr + ''; } else if (entry.Type == 'Meeting') { if (showCombinedDateTime) { - if (isToday(date)) + if (isToday(date) || isTomorrow(date)) entriesHtml += '' + time + ' '; else entriesHtml += '' + weekDay + '' + dateStr + ''; } else { - if (isToday(date) && showTodayAsText) + if ((isToday(date) || isTomorrow(date)) && showTodayAsText) entriesHtml += '' + dateStr + ' ' + time + ' '; else entriesHtml += '' + weekDay + '' + dateStr + '' + time + '';