From ecfb0bf42c0799a791ff5f11f37a1fcba7b48b83 Mon Sep 17 00:00:00 2001 From: "mvl%exedo.nl" Date: Thu, 15 Dec 2005 21:55:48 +0000 Subject: [PATCH] Bugzilla Bug 315719 Events with neither DTEND nor DURATION handled incorrectly (end date is default value 01-Jan-1970). r=mvl, patch by ssitter@googlemail.com git-svn-id: svn://10.0.0.236/trunk@186130 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/calendar/base/src/calEvent.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/mozilla/calendar/base/src/calEvent.js b/mozilla/calendar/base/src/calEvent.js index f94c993a90a..11a4e4f436a 100644 --- a/mozilla/calendar/base/src/calEvent.js +++ b/mozilla/calendar/base/src/calEvent.js @@ -216,6 +216,19 @@ calEvent.prototype = { this.endDate.addDuration(event.duration); } + // If endDate is still invalid neither a end time nor a duration is set + // on the event. We have to set endDate ourselves. + // If the start time is a date-time the event ends on the same calendar + // date and time of day. If the start time is a date the events + // non-inclusive end is the end of the calendar date. + if (!this.endDate.isValid) { + this.endDate = this.startDate.clone(); + if (this.startDate.isDate) { + this.endDate.day += 1; + this.endDate.normalize(); + } + } + // Importing didn't really change anything this.mDirty = false; },