From 7b49858cd1fcb737295bcba3d1bff3ee59c7b78b Mon Sep 17 00:00:00 2001 From: Michael Prager Date: Mon, 1 Mar 2010 12:10:10 +0100 Subject: [PATCH] replaced 'tomorrow' fix by Klaus Hildebrandt (more stable code). Also fixed a problem with the 'today' indicator in cases where the days & months match but not the year. --- comingNext/index.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/comingNext/index.html b/comingNext/index.html index 90a29cc..b722479 100644 --- a/comingNext/index.html +++ b/comingNext/index.html @@ -152,18 +152,18 @@ function error(message) function isToday(date) { - if (date.getDate() == now.getDate() && date.getMonth() == now.getMonth()) + if (date.getFullYear() == now.getFullYear() && date.getMonth() == now.getMonth() && date.getDate() == now.getDate()) return true; return false; } function isTomorrow(date) { - if ((date.getDate() == now.getDate() + 1 && date.getMonth() == now.getMonth()) || - (date.getDate() == 1 && date.getMonth() == now.getMonth() + 1) || - (date.getDate() == 1 && date.getMonth() == 0 && now.getMonth() == 11 && date.getYear() == now.getYear() + 1)) + var tomorrow = new Date (now.getTime() + 24 * 60 * 60 * 1000); + if (date.getFullYear() == tomorrow.getFullYear() && date.getMonth() == tomorrow.getMonth() && date.getDate() == tomorrow.getDate()) return true; - return false; + else + return false; } function collectLocales() -- 2.39.2