mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-30 00:01:50 +00:00
Update views to new timezone code, to show events spanning midnight better.
bug 307344, r=jminta
This commit is contained in:
parent
fed86a6bf9
commit
d398c6d8c0
@ -651,33 +651,8 @@ CalendarView.prototype.createEventBox = function(aItemOccurrence, aInteralFuncti
|
|||||||
var startDate;
|
var startDate;
|
||||||
var origEndDate;
|
var origEndDate;
|
||||||
|
|
||||||
if ("displayTimezone" in this) {
|
startDate = aItemOccurrence.startDate.getInTimezone(calendarDefaultTimezone()).clone();
|
||||||
startDate = aItemOccurrence.startDate.getInTimezone(this.displayTimezone).clone();
|
origEndDate = aItemOccurrence.endDate.getInTimezone(calendarDefaultTimezone()).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();
|
|
||||||
}
|
|
||||||
|
|
||||||
var displayStart = gCalendarWindow.currentView.displayStartDate;
|
var displayStart = gCalendarWindow.currentView.displayStartDate;
|
||||||
var displayEnd = gCalendarWindow.currentView.displayEndDate;
|
var displayEnd = gCalendarWindow.currentView.displayEndDate;
|
||||||
@ -690,6 +665,7 @@ CalendarView.prototype.createEventBox = function(aItemOccurrence, aInteralFuncti
|
|||||||
if(startDate.jsDate < displayStart) {
|
if(startDate.jsDate < displayStart) {
|
||||||
startDate.jsDate = displayStart;
|
startDate.jsDate = displayStart;
|
||||||
startDate.normalize();
|
startDate.normalize();
|
||||||
|
startDate = startDate.getInTimezone(calendarDefaultTimezone());
|
||||||
}
|
}
|
||||||
|
|
||||||
var endDate = startDate.clone();
|
var endDate = startDate.clone();
|
||||||
|
Loading…
Reference in New Issue
Block a user