From 864e697cc074794efd1d96de37aa5cab3c49cb13 Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Sun, 20 Nov 2011 20:53:05 -0500 Subject: [PATCH] CC-3068: Day/Week view and Month view under Calendar page have different ideas about what day is today -fixed "today" button behaving incorrectly. --- airtime_mvc/public/js/fullcalendar/fullcalendar.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/airtime_mvc/public/js/fullcalendar/fullcalendar.js b/airtime_mvc/public/js/fullcalendar/fullcalendar.js index f13a705c9..4cbc52436 100644 --- a/airtime_mvc/public/js/fullcalendar/fullcalendar.js +++ b/airtime_mvc/public/js/fullcalendar/fullcalendar.js @@ -399,7 +399,9 @@ function Calendar(element, options, eventSources) { elementOuterWidth = element.outerWidth(); header.updateTitle(currentView.title); - var today = new Date(); + //adjusting this date ensures that the "today" button is greyed out on the + //correct day. + var today = adjustDateToServerDate(new Date(), options["serverTimezoneOffset"]); if (today >= currentView.start && today < currentView.end) { header.disableButton('today'); }else{ @@ -581,7 +583,8 @@ function Calendar(element, options, eventSources) { function today() { - date = new Date(); + //adjusting this date ensures that clicking "today" takes us to the correct date. + date = adjustDateToServerDate(new Date(), options["serverTimezoneOffset"]); renderView(); }