From 3434aa6a04007ca6e7db119b1f60e94b0e0d8110 Mon Sep 17 00:00:00 2001 From: Aptivi Date: Thu, 3 Oct 2024 09:46:51 +0300 Subject: [PATCH] imp - Check for DTSTART if there is no METHOD --- 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 --- VisualCard.Calendar/Parsers/VCalendarParser.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/VisualCard.Calendar/Parsers/VCalendarParser.cs b/VisualCard.Calendar/Parsers/VCalendarParser.cs index 92cb8e3..27eafe6 100644 --- a/VisualCard.Calendar/Parsers/VCalendarParser.cs +++ b/VisualCard.Calendar/Parsers/VCalendarParser.cs @@ -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))