]> code.delx.au - comingnext/commitdiff
show "Tomorrow" instead of date if "showTodayAsText" is enabled
authorMichael Prager <michael@pragers.de>
Mon, 7 Dec 2009 18:09:14 +0000 (19:09 +0100)
committerMichael Prager <michael@pragers.de>
Mon, 7 Dec 2009 18:09:14 +0000 (19:09 +0100)
Readme.txt
build.bat
comingNext/Info.plist
comingNext/index.html
comingNextB/Info.plist
comingNextB/index.html

index 49ce96f123ba221e992d805fff213e36fe5fc497..fe98cc1eda35f5f434d2b52da954040e0ec5fdf4 100644 (file)
@@ -173,3 +173,5 @@ Changelog:
     timezone that has no DST, you should use this option\r
   - some code cleanup (by Paul Moore)\r
   - fixed alignment when calendar entries have very long description\r
+1.22 (2009-12-07) by Michael Prager\r
+  - show "Tomorrow" instead of date if "showNowAsText" is enabled
\ No newline at end of file
index 9f073b1d2c3f169508f60661c258e199ee7de3e3..290866bd1ccf07535952a42aa8e24fcc05223921 100644 (file)
--- a/build.bat
+++ b/build.bat
@@ -1,6 +1,6 @@
 @echo off\r
 \r
-set VERSION=1.21\r
+set VERSION=1.22\r
 \r
 del *.wgz\r
 del *.zip\r
index 9f4f8937968039ce039066fa4f109bda46cba02b..4384a4496107a56f532fc2873716f0287a561649 100644 (file)
@@ -2,9 +2,9 @@
 <!DOCTYPE plist PUBLIC "-//Nokia//DTD PLIST 1.0//EN" "http://www.nokia.com/NOKIA_COM_1/DTDs/plist-1.0.dtd">\r
 <plist version="1.0">\r
 <dict>\r
-       <key>DisplayName</key>                  <string>Coming Next 1.21</string>\r
+       <key>DisplayName</key>                  <string>Coming Next 1.22</string>\r
        <key>Identifier</key>                   <string>ar.com.cochambre.symbian.wrt.comingnext</string>\r
-       <key>Version</key>                      <string>1.21</string>\r
+       <key>Version</key>                      <string>1.22</string>\r
        <key>MainHTML</key>                     <string>index.html</string>\r
        <key>AllowNetworkAccess</key>           <false />\r
        <key>MiniViewEnabled</key>              <true/> \r
index 59dd6d099d57352aa1697c3efd15d8c249748f0f..f588884ef48c6a8d1662936c922449b3927dd3ea 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
index 51f724fd11a3c022c5d525f108385aa7e06e9355..0769779c42961b047aeb14abfd2b00d5764d7634 100644 (file)
@@ -2,9 +2,9 @@
 <!DOCTYPE plist PUBLIC "-//Nokia//DTD PLIST 1.0//EN" "http://www.nokia.com/NOKIA_COM_1/DTDs/plist-1.0.dtd">\r
 <plist version="1.0">\r
 <dict>\r
-       <key>DisplayName</key>                  <string>Coming Next B 1.21</string>\r
+       <key>DisplayName</key>                  <string>Coming Next B 1.22</string>\r
        <key>Identifier</key>                   <string>ar.com.cochambre.symbian.wrt.comingnextb</string>\r
-       <key>Version</key>                      <string>1.21</string>\r
+       <key>Version</key>                      <string>1.22</string>\r
        <key>MainHTML</key>                     <string>index.html</string>\r
        <key>AllowNetworkAccess</key>           <false />\r
        <key>MiniViewEnabled</key>              <true/> \r
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