Open vanlooverenkoen opened 9 months ago
Hey, thanks for your report! I believe this still works as expected after verifying this with the following test case:
test(
'UTC time parsing test',
() {
const text = '''BEGIN:VCALENDAR
VERSION:3.0
BEGIN:VEVENT
UID:19970610T172345Z-AF23B2@example.com
DTSTAMP:20240302T150000Z
DTSTART:20240302T150000Z
DTEND:20240302T170000Z
SUMMARY:🏁 FORMULA 1 GULF AIR BAHRAIN GRAND PRIX 2024 - Race
END:VEVENT
END:VCALENDAR''';
final calendar = VComponent.parse(text);
expect(calendar, isA<VCalendar>());
expect(calendar.children, isNotEmpty);
expect(calendar.children.length, 1);
expect(calendar.version, '3.0');
final event = calendar.children.first;
expect(event, isA<VEvent>());
expect(
(event as VEvent).summary,
'🏁 FORMULA 1 GULF AIR BAHRAIN GRAND PRIX 2024 - Race',
);
expect(event.start, DateTime.utc(2024, 03, 02, 15, 00, 00));
expect(event.end, DateTime.utc(2024, 03, 02, 17, 00, 00));
},
);
All date times given by the API are returned in UTC. Can you show me your code how you handle the dates?
The F1 ics returns utc date times:
URL: webcal://ics.ecal.com/ecal-sub/65d5e5b6532bea0008b2ee55/Formula%201.ics
But they are not parsed correctly. They are parsed as local time. I live in belgium so I get:
If I convert this to utc it becomes:
The output for my local time should be: