ExchangeCalendar / exchangecalendar

Exchange Calendar, Tasks, Contacts provider for Mozilla Thunderbird
GNU General Public License v3.0
677 stars 58 forks source link

Adding start/end time to all day event leads to 24h event starting at 0:00 #286

Closed basicmaster closed 5 years ago

basicmaster commented 5 years ago

(tested with v5.0.0-alpha3 branch)

It sometimes happens that I create an event for day X as an all day event, as I don't know the schedule yet. Some time later I want to add the actual start/end times. Setting these times (unchecking the all day checkbox) shows the correct times for a moment after saving the event. However after the event is reloaded from the server, the event is then an event starting from 0:00 on day X, going until 0:00 on day X+1. In the original Outlook Web App, this is no problem in contrast.

Steps to reproduce this:

  1. Create an event which is all-day (no start/end time) and save it
  2. Edit the event, adding start/end time (e.g. starting at 18:00, ending at 19:00).

Investigating this, the following results: Comparing the request of this plugin to the request of the Outlook Web App, it turns out that OWA (using JSON) transmits the IsAllDayEvent field before the Start and End fields - the order seems to matter here. Assuming that all changed fields are processed in the transmitted order, it seems (comparatively) reasonable that a start/end time update on an all day event doesn't really make sense and leads to that strange times....just moments before the all day property is set to false some lines below.

Hence switching the order - first unsetting the all day property, then setting the times - indeed fixes the issue. So adding start/end times to an all day event now works flawlessly. I will open a PR for this in a moment...

piper commented 5 years ago

I am experiencing a quite similar issue but it happens any time I create an "all day event" for the day X, I don't need to change it later by setting start/end times. The results is that the event is extended to day X+1. Do you think the recent commit might fix also this? Is there a build available? Thanks.

basicmaster commented 5 years ago

Creating an all day event itself doesn't lead to such behaviour in my case. Maybe different Outlook server versions are involved here.

I don't have code knowledge that is deep enough to be able to estimate if it fixes your issue, too. But if you want to try the fixed version yourself: https://basicmaster.de/test/exchangecalendar-v5.0.0-alpha3_SP.xpi

piper commented 5 years ago

I installed the version with your fix but my issue persists. Thunderbird version is 60.8, Lightning is 6.2.8. Do I need to provide other information?

basicmaster commented 5 years ago

It seems that your issue affects a different code part (creation vs. change). So I propose that you create a new issue (refering to this one as related) to describe the problem, as this one will get closed when the related fix is merged.

advancingu commented 5 years ago

Should be fixed now.