]> code.delx.au - comingnext/commitdiff
replaced 'tomorrow' fix by Klaus Hildebrandt (more stable code). Also fixed a problem...
authorMichael Prager <michael@pragers.de>
Mon, 1 Mar 2010 11:10:10 +0000 (12:10 +0100)
committerMichael Prager <michael@pragers.de>
Mon, 1 Mar 2010 11:10:10 +0000 (12:10 +0100)
comingNext/index.html

index 90a29ccc60f23610cda61e058dbe46005aabe85a..b722479b1a2df497c520553d599e9dbb3595dec0 100644 (file)
@@ -152,18 +152,18 @@ function error(message)
 \r
 function isToday(date)\r
 {\r
-       if (date.getDate() == now.getDate() && date.getMonth() == now.getMonth())\r
+       if (date.getFullYear() == now.getFullYear() && date.getMonth() == now.getMonth() && date.getDate() == now.getDate())\r
                return true;\r
        return false;\r
 }\r
 \r
 function isTomorrow(date)\r
 {\r
-       if ((date.getDate() == now.getDate() + 1 && date.getMonth() == now.getMonth()) ||\r
-           (date.getDate() == 1 && date.getMonth() == now.getMonth() + 1) ||\r
-           (date.getDate() == 1 && date.getMonth() == 0 && now.getMonth() == 11 && date.getYear() == now.getYear() + 1))\r
+       var tomorrow = new Date (now.getTime() + 24 * 60 * 60 * 1000);\r
+       if (date.getFullYear() == tomorrow.getFullYear() && date.getMonth() == tomorrow.getMonth() && date.getDate() == tomorrow.getDate())\r
                return true;\r
-       return false;\r
+       else\r
+               return false; \r
 }\r
 \r
 function collectLocales()\r