Skip to content

Commit

Permalink
imp - Check for DTSTART if there is no METHOD
Browse files Browse the repository at this point in the history
---

According to the vCalendar 2.0 specifications, if there is no METHOD, then DTSTART is required.

---

Type: imp
Breaking: False
Doc Required: False
Backport Required: False
Part: 1/1
  • Loading branch information
AptiviCEO committed Oct 3, 2024
1 parent 9142f54 commit 3434aa6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions VisualCard.Calendar/Parsers/VCalendarParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,10 @@ internal void ValidateCalendar(Parts.Calendar calendar)
calendar.CalendarVersion.Major == 2 ?
[VCalendarConstants._uidSpecifier, VCalendarConstants._dateStampSpecifier] : [];
string[] expectedTodoFields = expectedEventFields;
expectedEventFields =
calendar.CalendarVersion.Major == 2 && calendar.GetString(CalendarStringsEnum.Method).Length == 0 ?
[VCalendarConstants._dateStartSpecifier, .. expectedEventFields] :
expectedEventFields;
foreach (var eventInfo in calendar.events)
{
if (!ValidateComponent(ref expectedEventFields, out string[] actualEventFields, eventInfo))
Expand Down

0 comments on commit 3434aa6

Please sign in to comment.