Skip to content

Commit

Permalink
Fix mapping of weekday recurrence rule with FREQ=DAILY;BYDAY=MO,TU,WE…
Browse files Browse the repository at this point in the history
…,TH,FR

ticket #847.
  • Loading branch information
aluxnimm committed Mar 23, 2018
1 parent f222760 commit 4c7bbc4
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
10 changes: 9 additions & 1 deletion CalDavSynchronizer/Implementation/Events/EventEntityMapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -945,7 +945,15 @@ private void MapRecurrance2To1 (IEvent source, IReadOnlyCollection<IEvent> excep
switch (sourceRecurrencePattern.Frequency)
{
case FrequencyType.Daily:
targetRecurrencePattern.RecurrenceType = OlRecurrenceType.olRecursDaily;
if (sourceRecurrencePattern.ByDay.Count > 0)
{
targetRecurrencePattern.RecurrenceType = OlRecurrenceType.olRecursWeekly;
targetRecurrencePattern.DayOfWeekMask = CommonEntityMapper.MapDayOfWeek2To1 (sourceRecurrencePattern.ByDay);
}
else
{
targetRecurrencePattern.RecurrenceType = OlRecurrenceType.olRecursDaily;
}
break;
case FrequencyType.Weekly:
if (sourceRecurrencePattern.ByDay.Count > 0)
Expand Down
10 changes: 9 additions & 1 deletion CalDavSynchronizer/Implementation/Tasks/TaskMapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,15 @@ private void MapRecurrance2To1 (ITodo source, ITaskItemWrapper targetWrapper, IE
switch (sourceRecurrencePattern.Frequency)
{
case FrequencyType.Daily:
targetRecurrencePattern.RecurrenceType = OlRecurrenceType.olRecursDaily;
if (sourceRecurrencePattern.ByDay.Count > 0)
{
targetRecurrencePattern.RecurrenceType = OlRecurrenceType.olRecursWeekly;
targetRecurrencePattern.DayOfWeekMask = CommonEntityMapper.MapDayOfWeek2To1 (sourceRecurrencePattern.ByDay);
}
else
{
targetRecurrencePattern.RecurrenceType = OlRecurrenceType.olRecursDaily;
}
break;
case FrequencyType.Weekly:
if (sourceRecurrencePattern.ByDay.Count > 0)
Expand Down

0 comments on commit 4c7bbc4

Please sign in to comment.