Skip to content

Commit

Permalink
imp - doc - DateStart and DateEnd support more typ...
Browse files Browse the repository at this point in the history
...es

---

DateStart now supports todos, free/busy instances, and standard/daylight timezone info instances, while DateEnd supports free/busy. We've also added fixes for certain types, as well as fixed integer validation.

---

Type: imp
Breaking: False
Doc Required: True
Backport Required: False
Part: 1/1
  • Loading branch information
AptiviCEO committed Sep 11, 2024
1 parent 3f3b513 commit 4be5c6a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion VisualCard.Calendar/Parsers/VCalendarParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ private bool ValidateComponent<TComponent>(ref string[] expectedFields, out stri
case PartType.Integers:
{
int value = component.GetInteger((CalendarIntegersEnum)enumeration);
bool exists = value > -1;
bool exists = value != -1;
if (exists)
actualFieldList.Add(expectedFieldName);
}
Expand Down
10 changes: 5 additions & 5 deletions VisualCard.Calendar/Parsers/VCalendarParserTools.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ internal static bool StringSupported(CalendarStringsEnum stringsEnum, Version ca
CalendarStringsEnum.Transparency => TypeMatch(componentType, typeof(CalendarEvent)),
CalendarStringsEnum.Action => calendarVersion.Major == 2 && TypeMatch(componentType, typeof(CalendarAlarm)),
CalendarStringsEnum.Trigger => calendarVersion.Major == 2 && TypeMatch(componentType, typeof(CalendarAlarm)),
CalendarStringsEnum.TimeZoneId => calendarVersion.Major == 2 && TypeMatch(componentType, typeof(TimeZoneInfo)),
CalendarStringsEnum.TimeZoneUrl => calendarVersion.Major == 2 && TypeMatch(componentType, typeof(TimeZoneInfo)),
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)),
_ =>
throw new InvalidOperationException("Invalid string enumeration type to get supported value"),
Expand Down Expand Up @@ -74,10 +74,10 @@ internal static bool EnumArrayTypeSupported(CalendarPartsArrayEnum partsArrayEnu
CalendarPartsArrayEnum.Attendee => TypeMatch(componentType, typeof(CalendarEvent), typeof(CalendarTodo), typeof(CalendarJournal), typeof(CalendarFreeBusy), typeof(CalendarAlarm)),
CalendarPartsArrayEnum.DateCreated => TypeMatch(componentType, typeof(CalendarEvent), typeof(CalendarTodo), typeof(CalendarJournal)),
CalendarPartsArrayEnum.DateCreatedAlt => TypeMatch(componentType, typeof(CalendarEvent), typeof(CalendarTodo)),
CalendarPartsArrayEnum.DateStart => TypeMatch(componentType, typeof(CalendarEvent)),
CalendarPartsArrayEnum.DateEnd => TypeMatch(componentType, typeof(CalendarEvent)),
CalendarPartsArrayEnum.DateStart => TypeMatch(componentType, typeof(CalendarEvent), typeof(CalendarTodo), typeof(CalendarFreeBusy), typeof(CalendarStandard), typeof(CalendarDaylight)),
CalendarPartsArrayEnum.DateEnd => TypeMatch(componentType, typeof(CalendarEvent), typeof(CalendarFreeBusy)),
CalendarPartsArrayEnum.DateStamp => calendarVersion.Major == 2 && TypeMatch(componentType, typeof(CalendarEvent), typeof(CalendarTodo), typeof(CalendarJournal), typeof(CalendarFreeBusy)),
CalendarPartsArrayEnum.TimeZoneName => calendarVersion.Major == 2 && TypeMatch(componentType, typeof(TimeZoneNameInfo)),
CalendarPartsArrayEnum.TimeZoneName => calendarVersion.Major == 2 && TypeMatch(componentType, typeof(CalendarTimeZone)),
CalendarPartsArrayEnum.RecDate => calendarVersion.Major == 2 && TypeMatch(componentType, typeof(CalendarEvent), typeof(CalendarTodo), typeof(CalendarJournal), typeof(CalendarStandard), typeof(CalendarDaylight)),
CalendarPartsArrayEnum.NonstandardNames => true,
_ =>
Expand Down
4 changes: 2 additions & 2 deletions VisualCard.Calendar/Parts/Enums/CalendarPartsArrayEnum.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ public enum CalendarPartsArrayEnum
/// </summary>
DateCreatedAlt,
/// <summary>
/// Event date start
/// Date start (event, to-do, free/busy, or standard/daylight timezone components)
/// </summary>
DateStart,
/// <summary>
/// Event date end
/// Date end (event or free/busy)
/// </summary>
DateEnd,
/// <summary>
Expand Down

0 comments on commit 4be5c6a

Please sign in to comment.