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