Closed walles closed 9 years ago
Note that this change builds on the unit testing support introduced by PR #180.
Hi @walles, Thank you for your efforts and for your patience. These commits give me mixed feelings, and so I cannot except them. Let me explain:
The definition of spansOneFullDay()
in this PR matches the behavior of Google Calendar's web UI.
@walles but it doesn't match the name of this method. So it becomes misleading and may cause further bugs...
Google's web UI actually displays the event as spanning one full day.
What would you call the method?
I mean that the code, which you proposed for the method, looks like a hack, which works by coincidence. The proposed code means "spansNotMoreThanOneFullDay" ?!
No it doesn't, I think you've been reading an earlier version of the patch.
The current version's logic is:
"No it doesn't, I think you've been reading an earlier version of the patch." Now I see, your Pull request has commits, which override each other...
@yvolk I rebased this on top of your fix for the NPE crash, could you have another look?
@walles We implemented the com.plusonelabs.calendar.calendar.CalendarEventProvider#fixAllDayEvent procedure, which fixes such "wonky zero days all-day events". Please test!
So this pull request became obsolete and may be closed?!
Just from reading the code, that should do it.
The event in my calendar was on the 30th of August (and it's in a calendar to which I only have read access), so I can't verify.
Thanks for fixing this, I'll re-open if I see this behavior again.
In some cases it's possible to get an all day event into the calendar that spans zero days (starts and ends at the same timestamp). Google Calendar's web UI renders such events as spanning one full day, so we should do that as well.
I have no idea how to put such events in the calendar, but I have one of them in mine so it is possible.
Without this change, the Calendar Widget says about my event that it starts on Sunday (correct) and ends on the day before, Saturday (wrong).
This does seem to be a corner case, because at least one other calendar app (DigiKal) also fails at this event. In their case they render the (all day Sunday) event as starting on Saturday (wrong) and ending on Friday (even more wrong).