CC-3068: Day/Week view and Month view under Calendar page have different ideas about what day is today

-fixed "today" button behaving incorrectly.
This commit is contained in:
Martin Konecny 2011-11-20 20:53:05 -05:00
parent ddd430be84
commit 864e697cc0

View file

@ -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();
}