Skip to content

Commit

Permalink
When an all day event is modified to have start/end times
Browse files Browse the repository at this point in the history
(i.e. no longer being an all day event), the order of the transmitted
properties matters for OWA. So the all day property has to be transmitted
before the start/end times, as otherwise the desired times are not applied.

Closes ExchangeCalendar#286.
  • Loading branch information
basicmaster committed Jul 14, 2019
1 parent 73cd78f commit c0dd878
Showing 1 changed file with 25 additions and 23 deletions.
48 changes: 25 additions & 23 deletions calendar/interface/exchangeEvent/mivExchangeEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,31 @@ mivExchangeEvent.prototype = {
}


// IsAllDayEvent must be inserted before Start/End, as updating the latter won't work if the event was all day previously
// See also: https://github.com/ExchangeCalendar/exchangecalendar/issues/286
if (this._newStartDate) {
this._nonPersonalDataChanged = true;
if (this._newStartDate.isDate) {
this.addSetItemField(updates, "IsAllDayEvent", "true");
}
else {
this.addSetItemField(updates, "IsAllDayEvent", "false");
}

}
else {
if (this._newEndDate) {
this._nonPersonalDataChanged = true;
if (this._newEndDate.isDate) {
this.addSetItemField(updates, "IsAllDayEvent", "true");
}
else {
this.addSetItemField(updates, "IsAllDayEvent", "false");
}

}
}

if (this._newStartDate) {
var tmpStart = this._newStartDate.clone();
if (this._newStartDate.isDate) {
Expand Down Expand Up @@ -443,29 +468,6 @@ mivExchangeEvent.prototype = {
}
}

if (this._newStartDate) {
this._nonPersonalDataChanged = true;
if (this._newStartDate.isDate) {
this.addSetItemField(updates, "IsAllDayEvent", "true");
}
else {
this.addSetItemField(updates, "IsAllDayEvent", "false");
}

}
else {
if (this._newEndDate) {
this._nonPersonalDataChanged = true;
if (this._newEndDate.isDate) {
this.addSetItemField(updates, "IsAllDayEvent", "true");
}
else {
this.addSetItemField(updates, "IsAllDayEvent", "false");
}

}
}

if (((this._newStartDate) || (this._newEndDate)) && (this.calendar.isVersion2007)) {
if (this._newStartDate) {
this.addSetItemField(updates, "MeetingTimeZone", null, {
Expand Down

0 comments on commit c0dd878

Please sign in to comment.