Commit 0eb79b3c authored by michael.buettner%sun.com's avatar michael.buettner%sun.com
Browse files

now handling freebusy for allday events properly

parent c15df7d4
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -1350,6 +1350,7 @@
            var kDefaultTimezone = calendarDefaultTimezone();
            this.mStartDate = aStartDate.getInTimezone(kDefaultTimezone);
            this.mEndDate = aEndDate.getInTimezone(kDefaultTimezone);
            var endDate = this.mEndDate.clone();
                
            // Check if an all-day event has been passed in (to adapt endDate).
            if (this.mStartDate.isDate) {
@@ -1362,9 +1363,11 @@
                // in local timezone.
                this.mEndDate.normalize();
                this.mStartDate.normalize();
                endDate.normalize();
            }
            this.mStartDate.makeImmutable();
            this.mEndDate.makeImmutable();
            endDate.makeImmutable();

            document.getAnonymousElementByAttribute(this, "anonid", "event-starttime").value = this.mStartDate.jsDate;
            document.getAnonymousElementByAttribute(this, "anonid", "event-endtime").value = this.mEndDate.jsDate;
@@ -1372,7 +1375,7 @@
            // tell the timebar about the new start/enddate
            var timebar = document.getAnonymousElementByAttribute(this, "anonid", "timebar");
            timebar.startDate = this.mStartDate;
            timebar.endDate = this.mEndDate;
            timebar.endDate = endDate;
            timebar.refresh();
          ]]>
        </body>
+6 −0
Original line number Diff line number Diff line
@@ -159,6 +159,7 @@
          var date = val.clone();
          date.hour = 0;
          date.minute = 0;
          date.isDate = false;

          if (!this.mDateFormatter) {
            this.mDateFormatter = Components.classes["@mozilla.org/calendar/datetime-formatter;1"]
@@ -298,11 +299,13 @@
          var container = document.getAnonymousElementByAttribute(this, "anonid", "container");
          var date = this.mStartDate.clone();
          date.day += val;
          date.normalize();
          var numChilds = container.childNodes.length;
          for(var i=0; i<numChilds; i++) {
            var child = container.childNodes[i];
            child.date = date;
            date.day++;
            date.normalize();
          }
          return val;
        ]]>
@@ -410,6 +413,7 @@
            child.endDate = this.mEndDate;
            child.date = date;
            date.day++;
            date.normalize();
          }
          var offset = this.mDayOffset;
          this.dayOffset = offset;
@@ -442,6 +446,7 @@
            if(count > 0) {
              for(var i=0; i<count; i++) {
                date.day++;
                date.normalize();
                var newNode = template.cloneNode(false);
                newNode.startDate = this.mStartDate;
                newNode.endDate = this.mEndDate;
@@ -615,6 +620,7 @@
              }
              date.hour = this.mStartHour;
              date.day++;
              date.normalize();
            }
          }
          ]]>
+10 −0
Original line number Diff line number Diff line
@@ -142,6 +142,16 @@ function onTabSelected()
    var kDefaultTimezone = calendarDefaultTimezone();
    var startDate = jsDateToDateTime(getElementValue("event-starttime"));
    var endDate = jsDateToDateTime(getElementValue("event-endtime"));
    startDate = startDate.getInTimezone(kDefaultTimezone);
    endDate = endDate.getInTimezone(kDefaultTimezone);
    var isAllDay = getElementValue("event-all-day", "checked");
    if (isAllDay) {
        startDate.isDate = true;
        startDate.normalize();
        endDate.isDate = true;
        endDate.day += 1;
        endDate.normalize();
    }
    attendees.setTimeRange(startDate,endDate);
  }
}