From a93f130ffb645adbd3523cb9b3ebe8898d54142f Mon Sep 17 00:00:00 2001 From: "mvl%exedo.nl" Date: Wed, 21 Sep 2005 20:53:25 +0000 Subject: [PATCH] Use the new timezone api's in the views, to handle floating items better. bug 307344, r=jminta --- calendar/resources/content/calendarWindow.js | 30 ++------------------ 1 file changed, 3 insertions(+), 27 deletions(-) diff --git a/calendar/resources/content/calendarWindow.js b/calendar/resources/content/calendarWindow.js index 44c0d8e652e..a025f4a988b 100644 --- a/calendar/resources/content/calendarWindow.js +++ b/calendar/resources/content/calendarWindow.js @@ -656,33 +656,8 @@ CalendarView.prototype.createEventBox = function(aItemOccurrence, aInteralFuncti var startDate; var origEndDate; - if ("displayTimezone" in this) { - startDate = aItemOccurrence.startDate.getInTimezone(this.displayTimezone).clone(); - origEndDate = aItemOccurrence.endDate.getInTimezone(this.displayTimezone).clone(); - } else { - // Copy the values from jsDate. jsDate is in de users timezone - // It's a hack, but it kind of works. It doesn't set the right - // timezone info for the date, but that's not a real problem. - startDate = aItemOccurrence.startDate.clone(); - var jsDate = startDate.jsDate; - startDate.year = jsDate.getFullYear(); - startDate.month = jsDate.getMonth(); - startDate.day = jsDate.getDate(); - startDate.hour = jsDate.getHours(); - startDate.minute = jsDate.getMinutes(); - startDate.second = jsDate.getSeconds(); - startDate.normalize(); - - origEndDate = aItemOccurrence.endDate.clone(); - jsDate = origEndDate.jsDate; - origEndDate.year = jsDate.getFullYear(); - origEndDate.month = jsDate.getMonth(); - origEndDate.day = jsDate.getDate(); - origEndDate.hour = jsDate.getHours(); - origEndDate.minute = jsDate.getMinutes(); - origEndDate.second = jsDate.getSeconds(); - origEndDate.normalize(); - } + startDate = aItemOccurrence.startDate.getInTimezone(calendarDefaultTimezone()).clone(); + origEndDate = aItemOccurrence.endDate.getInTimezone(calendarDefaultTimezone()).clone(); var displayStart = gCalendarWindow.currentView.displayStartDate; var displayEnd = gCalendarWindow.currentView.displayEndDate; @@ -695,6 +670,7 @@ CalendarView.prototype.createEventBox = function(aItemOccurrence, aInteralFuncti if(startDate.jsDate < displayStart) { startDate.jsDate = displayStart; startDate.normalize(); + startDate = startDate.getInTimezone(calendarDefaultTimezone()); } var endDate = startDate.clone();