[GH-ISSUE #27] one yearly recurrence pattern is not implemented #19

Closed
opened 2026-02-25 20:30:43 +03:00 by kerem · 3 comments
Owner

Originally created by @aluxnimm on GitHub (Apr 7, 2015).
Original GitHub issue: https://github.com/aluxnimm/outlookcaldavsynchronizer/issues/27

Originally assigned to: @aluxnimm on GitHub.

e.g. every 2nd thursday in april every year

following code in MapRecurrance2To1 in case FrequencyType.Yearly fixes it:

...

      else if (sourceRecurrencePattern.ByMonth.Count > 0 && sourceRecurrencePattern.ByDay.Count > 0)
        {
            targetRecurrencePattern.RecurrenceType = OlRecurrenceType.olRecursYearNth;
            if (sourceRecurrencePattern.ByMonth.Count > 1)
            {
                s_logger.WarnFormat("Event '{0}' contains more than one months in a yearly recurrence rule. Since outlook supports only one month, all except the first one will be ignored.", source.Url);
            }
            targetRecurrencePattern.MonthOfYear = sourceRecurrencePattern.ByMonth[0];

            targetRecurrencePattern.DayOfWeekMask = MapDayOfWeek2To1(sourceRecurrencePattern.ByDay);

            targetRecurrencePattern.Instance = sourceRecurrencePattern.ByDay[0].Offset; 
        }

Original comment by: aluxnimm

Original Ticket: outlookcaldavsynchronizer/20

Originally created by @aluxnimm on GitHub (Apr 7, 2015). Original GitHub issue: https://github.com/aluxnimm/outlookcaldavsynchronizer/issues/27 Originally assigned to: @aluxnimm on GitHub. e.g. every 2nd thursday in april every year following code in MapRecurrance2To1 in case FrequencyType.Yearly fixes it: ... ``` else if (sourceRecurrencePattern.ByMonth.Count > 0 && sourceRecurrencePattern.ByDay.Count > 0) { targetRecurrencePattern.RecurrenceType = OlRecurrenceType.olRecursYearNth; if (sourceRecurrencePattern.ByMonth.Count > 1) { s_logger.WarnFormat("Event '{0}' contains more than one months in a yearly recurrence rule. Since outlook supports only one month, all except the first one will be ignored.", source.Url); } targetRecurrencePattern.MonthOfYear = sourceRecurrencePattern.ByMonth[0]; targetRecurrencePattern.DayOfWeekMask = MapDayOfWeek2To1(sourceRecurrencePattern.ByDay); targetRecurrencePattern.Instance = sourceRecurrencePattern.ByDay[0].Offset; } ``` Original comment by: aluxnimm Original Ticket: [outlookcaldavsynchronizer/20](https://sourceforge.net/p/outlookcaldavsynchronizer/20)
kerem 2026-02-25 20:30:43 +03:00
Author
Owner

@aluxnimm commented on GitHub (Apr 9, 2015):

  • Description has changed:

Diff:


--- old
+++ new
@@ -14,4 +14,6 @@
                 targetRecurrencePattern.MonthOfYear = sourceRecurrencePattern.ByMonth[0];

                 targetRecurrencePattern.DayOfWeekMask = MapDayOfWeek2To1(sourceRecurrencePattern.ByDay);
+
+                targetRecurrencePattern.Instance = sourceRecurrencePattern.ByDay[0].Offset; 
             }

Original comment by: aluxnimm

<!-- gh-comment-id:126312535 --> @aluxnimm commented on GitHub (Apr 9, 2015): - Description has changed: Diff: ``` --- old +++ new @@ -14,4 +14,6 @@ targetRecurrencePattern.MonthOfYear = sourceRecurrencePattern.ByMonth[0]; targetRecurrencePattern.DayOfWeekMask = MapDayOfWeek2To1(sourceRecurrencePattern.ByDay); + + targetRecurrencePattern.Instance = sourceRecurrencePattern.ByDay[0].Offset; } ``` Original comment by: aluxnimm
Author
Owner

@aluxnimm commented on GitHub (Apr 10, 2015):

Some more fixes for monthly and yearly patterns are needed.
Just the monthly or yearly pattern alone without day or dayofweek are valid e.g.
BEGIN:VCALENDAR
VERSION:2.0
BEGIN:VEVENT
LAST-MODIFIED:20130129T141112Z
DTSTAMP:20130129T141112Z
UID:35475026-1869-47dd-839a-95f7088593c7
SUMMARY:Kontoauszug
RRULE:FREQ=MONTHLY;UNTIL=20121209T000000
DTSTART;VALUE=DATE:20100808
DTEND;VALUE=DATE:20100809
END:VEVENT
END:VCALENDAR

So the else part in the monthly and yearly cases should just set
the targetRecurrencePattern.RecurrenceType to Monthly or Yearly instead of warning about a not supported rule.

Original comment by: aluxnimm

<!-- gh-comment-id:126312536 --> @aluxnimm commented on GitHub (Apr 10, 2015): Some more fixes for monthly and yearly patterns are needed. Just the monthly or yearly pattern alone without day or dayofweek are valid e.g. BEGIN:VCALENDAR VERSION:2.0 BEGIN:VEVENT LAST-MODIFIED:20130129T141112Z DTSTAMP:20130129T141112Z UID:35475026-1869-47dd-839a-95f7088593c7 SUMMARY:Kontoauszug RRULE:FREQ=MONTHLY;UNTIL=20121209T000000 DTSTART;VALUE=DATE:20100808 DTEND;VALUE=DATE:20100809 END:VEVENT END:VCALENDAR So the else part in the monthly and yearly cases should just set the targetRecurrencePattern.RecurrenceType to Monthly or Yearly instead of warning about a not supported rule. Original comment by: aluxnimm
Author
Owner

@aluxnimm commented on GitHub (Apr 11, 2015):

  • status: open --> closed
  • assigned_to: Alexander Nimmervoll

Original comment by: aluxnimm

<!-- gh-comment-id:126312537 --> @aluxnimm commented on GitHub (Apr 11, 2015): - **status**: open --> closed - **assigned_to**: Alexander Nimmervoll Original comment by: aluxnimm
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/outlookcaldavsynchronizer#19
No description provided.