From 33d733e36463544984e41bbddca19dc889d2fc8b Mon Sep 17 00:00:00 2001 From: Adam Shaw Date: Tue, 19 Aug 2014 17:24:23 -0700 Subject: [PATCH] make sure TimeGrid's cell datetimes are in the calendar's timezone --- src/common/TimeGrid.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/common/TimeGrid.js b/src/common/TimeGrid.js index c15c067..7dd23f1 100644 --- a/src/common/TimeGrid.js +++ b/src/common/TimeGrid.js @@ -198,9 +198,12 @@ $.extend(TimeGrid.prototype, { // Gets the datetime for the given slot cell getCellDate: function(cell) { - // the View's cellToDate system only accounts for the beginning of whole days - return this.view.cellToDate(0, cell.col).time( - this.minTime + this.snapDuration * cell.row + var view = this.view; + var calendar = view.calendar; + + return calendar.rezoneDate( // since we are adding a time, it needs to be in the calendar's timezone + view.cellToDate(0, cell.col) // View's coord system only accounts for start-of-day for column + .time(this.minTime + this.snapDuration * cell.row) ); },