Skip to content

Commit

Permalink
add - doc - Added EXRULE for vCalendar 1.0
Browse files Browse the repository at this point in the history
---

We've added EXRULE that describes a recurrence rule for exclusions.

---

Type: add
Breaking: False
Doc Required: True
Backport Required: False
Part: 1/1
  • Loading branch information
AptiviCEO committed Oct 1, 2024
1 parent 60ff9b1 commit b0e494b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions VisualCard.Calendar/Parsers/VCalendarConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ internal static class VCalendarConstants
internal const string _dAlarmSpecifier = "DALARM";
internal const string _mAlarmSpecifier = "MALARM";
internal const string _pAlarmSpecifier = "PALARM";
internal const string _exRuleSpecifier = "EXRULE";

// Available in vCalendar 2.0
internal const string _dateStampSpecifier = "DTSTAMP";
Expand Down
3 changes: 3 additions & 0 deletions VisualCard.Calendar/Parsers/VCalendarParserTools.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ internal static bool StringSupported(CalendarStringsEnum stringsEnum, Version ca
CalendarStringsEnum.TimeZoneId => calendarVersion.Major == 2 && TypeMatch(componentType, typeof(CalendarTimeZone)),
CalendarStringsEnum.TimeZoneUrl => calendarVersion.Major == 2 && TypeMatch(componentType, typeof(CalendarTimeZone)),
CalendarStringsEnum.Recursion => TypeMatch(componentType, typeof(CalendarEvent), typeof(CalendarTodo), typeof(CalendarJournal), typeof(CalendarStandard), typeof(CalendarDaylight)),
CalendarStringsEnum.ExRule => calendarVersion.Major == 1 && TypeMatch(componentType, typeof(CalendarEvent), typeof(CalendarTodo)),
_ =>
throw new InvalidOperationException("Invalid string enumeration type to get supported value"),
};
Expand Down Expand Up @@ -120,6 +121,7 @@ internal static string GetPrefixFromStringsEnum(CalendarStringsEnum stringsEnum)
CalendarStringsEnum.TimeZoneId => VCalendarConstants._tzidSpecifier,
CalendarStringsEnum.TimeZoneUrl => VCalendarConstants._tzUrlSpecifier,
CalendarStringsEnum.Recursion => VCalendarConstants._recurseSpecifier,
CalendarStringsEnum.ExRule => VCalendarConstants._exRuleSpecifier,
_ =>
throw new NotImplementedException($"String enumeration {stringsEnum} is not implemented.")
};
Expand Down Expand Up @@ -272,6 +274,7 @@ internal static (PartType type, object enumeration, Type? enumType, Func<string,
VCalendarConstants._tzidSpecifier => (PartType.Strings, CalendarStringsEnum.TimeZoneId, null, null, "", "", "text", []),
VCalendarConstants._tzUrlSpecifier => (PartType.Strings, CalendarStringsEnum.TimeZoneUrl, null, null, "", "", "uri", []),
VCalendarConstants._recurseSpecifier => (PartType.Strings, CalendarStringsEnum.Recursion, null, null, "", "", "recur", []),
VCalendarConstants._exRuleSpecifier => (PartType.Strings, CalendarStringsEnum.ExRule, null, null, "", "", "recur", []),
VCalendarConstants._prioritySpecifier => (PartType.Integers, CalendarIntegersEnum.Priority, null, null, "", "", "integer", []),
VCalendarConstants._sequenceSpecifier => (PartType.Integers, CalendarIntegersEnum.Sequence, null, null, "", "", "integer", []),
VCalendarConstants._percentCompletionSpecifier => (PartType.Integers, CalendarIntegersEnum.PercentComplete, null, null, "", "", "integer", []),
Expand Down
4 changes: 4 additions & 0 deletions VisualCard.Calendar/Parts/Enums/CalendarStringsEnum.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,9 @@ public enum CalendarStringsEnum
/// Calendar recursion (event, todo, journal, or standard/daylight timezone components)
/// </summary>
Recursion,
/// <summary>
/// Calendar recursion rule for exclusions (event or todo)
/// </summary>
ExRule,
}
}

0 comments on commit b0e494b

Please sign in to comment.