Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…alendarSync into release

Resolves #1035
  • Loading branch information
phw198 committed Oct 10, 2020
2 parents c3d206f + 341021b commit 8429cd9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/OutlookGoogleCalendarSync/Recurrence.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public List<String> BuildGooglePattern(AppointmentItem ai, Event ev) {
RecurrencePattern rp = null;
try {
rp = ai.GetRecurrencePattern();
gPattern.Add("RRULE:" + buildRrule(rp));
gPattern.Add("RRULE:" + buildRrule(rp, ai.Start.TimeOfDay));
} finally {
rp = (RecurrencePattern)OutlookOgcs.Calendar.ReleaseObject(rp);
}
Expand Down Expand Up @@ -212,7 +212,7 @@ public void CompareOutlookPattern(Event ev, ref RecurrencePattern aiOpattern, Sy
}
}

private String buildRrule(RecurrencePattern oPattern) {
private String buildRrule(RecurrencePattern oPattern, TimeSpan startTime) {
log.Fine("Building RRULE");
rrule = new Dictionary<String, String>();
#region RECURRENCE PATTERN
Expand Down Expand Up @@ -290,7 +290,8 @@ private String buildRrule(RecurrencePattern oPattern) {
#region RECURRENCE RANGE
if (!oPattern.NoEndDate) {
log.Fine("Checking end date.");
addRule(rrule, "UNTIL", Recurrence.IANAdate(oPattern.PatternEndDate + oPattern.StartTime.TimeOfDay));
//oPattern.StartTime is for the organisers timezone, not the recipient - unlike ai.Start;
addRule(rrule, "UNTIL", Recurrence.IANAdate(oPattern.PatternEndDate + startTime));
}
#endregion
return string.Join(";", rrule.Select(x => x.Key + "=" + x.Value).ToArray());
Expand Down

0 comments on commit 8429cd9

Please sign in to comment.