Open rfc2822 opened 1 year ago
Could reproduce the problem.
@ArnyminerZ Can you please create a new JUnit test that runs outside Android instrumentation (in test
, not androidTest
) and doesn't require any ical4android methods to test parsing of:
VERSION:2.0
BEGIN:VEVENT
UID:xxx@xxx.de
DTSTART;TZID=Europe/Berlin:20230905T200000
DTEND;TZID=Europe/Berlin:20230905T210000
SUMMARY:xxxxxxxxxxxxxxxxxxx
END:VEVENT
BEGIN:VTIMEZONE
TZID:Europe/Berlin
BEGIN:DAYLIGHT
DTSTART:20230326T030000
TZOFFSETFROM:+0100
TZOFFSETTO:+0200
TZNAME:CEST
END:DAYLIGHT
BEGIN:STANDARD
DTSTART:20231029T020000
TZOFFSETFROM:+0200
TZOFFSETTO:+0100
TZNAME:CET
END:STANDARD
BEGIN:DAYLIGHT
DTSTART:20240331T030000
TZOFFSETFROM:+0100
TZOFFSETTO:+0200
TZNAME:CEST
END:DAYLIGHT
BEGIN:STANDARD
DTSTART:20241027T020000
TZOFFSETFROM:+0200
TZOFFSETTO:+0100
TZNAME:CET
END:STANDARD
END:VTIMEZONE
END:VCALENDAR
If you then get the dtStart.value
, it should be at 20⁰⁰ like this:
val e = c.getComponent<VEvent>(Component.VEVENT)
assertEquals("20230905T200000", e.startDate.value)
However it's at 01⁰⁰ here. If you can confirm, please create an issue in ical4j with the ical4android-independent test and mark this issue as dependence.
I've created this test:
class WordpressEventsManagerTest {
@Test
fun test_parsing() {
val calendar = CalendarBuilder().build(
StringReader(
"BEGIN:VCALENDAR\n" +
"VERSION:2.0\n" +
"BEGIN:VEVENT\n" +
"UID:xxx@xxx.de\n" +
"DTSTART;TZID=Europe/Berlin:20230905T200000\n" +
"DTEND;TZID=Europe/Berlin:20230905T210000\n" +
"SUMMARY:xxxxxxxxxxxxxxxxxxx\n" +
"END:VEVENT\n" +
"BEGIN:VTIMEZONE\n" +
"TZID:Europe/Berlin\n" +
"BEGIN:DAYLIGHT\n" +
"DTSTART:20230326T030000\n" +
"TZOFFSETFROM:+0100\n" +
"TZOFFSETTO:+0200\n" +
"TZNAME:CEST\n" +
"END:DAYLIGHT\n" +
"BEGIN:STANDARD\n" +
"DTSTART:20231029T020000\n" +
"TZOFFSETFROM:+0200\n" +
"TZOFFSETTO:+0100\n" +
"TZNAME:CET\n" +
"END:STANDARD\n" +
"BEGIN:DAYLIGHT\n" +
"DTSTART:20240331T030000\n" +
"TZOFFSETFROM:+0100\n" +
"TZOFFSETTO:+0200\n" +
"TZNAME:CEST\n" +
"END:DAYLIGHT\n" +
"BEGIN:STANDARD\n" +
"DTSTART:20241027T020000\n" +
"TZOFFSETFROM:+0200\n" +
"TZOFFSETTO:+0100\n" +
"TZNAME:CET\n" +
"END:STANDARD\n" +
"END:VTIMEZONE\n" +
"END:VCALENDAR"
)
)
val event = calendar.getComponent<VEvent>(Component.VEVENT)
assert(event.startDate.value == "20230905T200000") {
"Start date does not match. Expected: <20230905T200000>. Actual: <${event.startDate.value}>"
}
}
}
And it fails with Start date does not match. Expected: <20230905T200000>. Actual: <20230905T010000>
, so yeah, I can confirm
This PR/issue depends on:
Discussed in https://github.com/bitfireAT/icsx5/discussions/149
Depends on https://github.com/ical4j/ical4j/issues/651