Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Time of Event not correct with Events from Wordpress Events Manager #112

Open
rfc2822 opened this issue Sep 3, 2023 · 3 comments
Open
Assignees
Labels
bug Something isn't working dependent

Comments

@rfc2822
Copy link
Member

rfc2822 commented Sep 3, 2023

Discussed in bitfireAT/icsx5#149

Originally posted by derlucas April 21, 2023
I have trouble using the App with Calendars from Events Manager Wordpress Plugin.
The Events are saved with Timezone "Berlin" at 19:00 and shown correctly on the Wordpress Site. In the ICS file the Entry is like this:

DTSTART;TZID=Europe/Berlin:20230421T190000 DTEND;TZID=Europe/Berlin:20230421T235900

But in my Android Calendar (Simple Mobile Tools Calendar the Event is show at 01:00 in the night instead of 19:00. I tested the Google Calendar App too, and it shows the same false Time.

What would be the best way to find the root of the Issue?

Depends on ical4j/ical4j#651

@rfc2822 rfc2822 added the bug Something isn't working label Sep 3, 2023
@rfc2822
Copy link
Member Author

rfc2822 commented Sep 3, 2023

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.

@rfc2822 rfc2822 transferred this issue from bitfireAT/icsx5 Sep 3, 2023
@ArnyminerZ
Copy link
Member

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

@github-actions
Copy link

github-actions bot commented Sep 4, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dependent
Projects
None yet
Development

No branches or pull requests

2 participants