JodliDev / calendar

GNU Affero General Public License v3.0
16 stars 12 forks source link

"All day" events are shown as during 1 day longer in the roundcube UI #6

Closed n-peugnet closed 2 years ago

n-peugnet commented 2 years ago

This seems to be a result of this upstream's update of fullcalendar.

More specifically this commit explains that in fullcalendar "allDay event's end date must be exclusive". This is the same way to store all day events as Vcard, and thus CalDAV. But this commit indicates that this might not be the way the upstream's plugin stores them.

In this plugin, This could be fixed by removing these lines, but it would also break the other drivers I guess: https://github.com/JodliDev/calendar/blob/64599f4cfe63fcb900ae0bb7a1f11f85576f471b/calendar.php#L2145-L2147

I still do not understand why (and how) the events are currently stored in the DB using exclusive end dates when the code in calendar.php expects them to be stored using inclusive end dates (c.f. previous lines).

JodliDev commented 2 years ago

Hmm I thought that this problem was related to the problems discussed in https://github.com/JodliDev/libcalendaring/pull/1 But it seems now that it might be something different. What is confusing me is the fact that events seem to be displayed correctly when they are freshly created but are then wrong when the page is reloaded.

I am now wondering if that is a bug in our caldav implementation or a bug in roundcube calendar in general. Have you tested if this problem also occurs with other drivers?

JodliDev commented 2 years ago

First day of trying to get behind the cause of this one: When setting an allday event from 2022-7-5 until 2022-7-10

It will be saved in the db as:

I havent figured where in the caldav portin this change occurs (since the same information is sent from the front end) but I am moving closer ;)

EDIT: To be exact, it saves the same than "database" mode (so 2022-7-5 12:00 until 2022-7-10 13:00) and then changes it to 2022-7-5 00:00 until 2022-7-11 00:00 as soon as it checks for updates with the server.

So there seems to be a bug when getting updates from caldav. Dates are saved correctly to caldav (other GUIs show the correct dates). But the calendar handles the dates it gets from caldav, wrongly.

n-peugnet commented 2 years ago

Thank you @JodliDev, your fix works as expected! I can drop my workaround.