Simple-Calendar
Simple-Calendar copied to clipboard
bugfix multi week event not showing in next week
Description
- As reported in issue #1799 , events that span more than one week were not visible in the last week.
could you give exact steps for reproducing what does this fix? With specific dates to be set.
could you give exact steps for reproducing what does this fix? With specific dates to be set.
Hello @tibbi, Thanks for taking time to review, below are the steps to reproduce the bug and the last is the screen shot of the fix
1. First uncheck this option in settings -> weekly view
2. Switch to week view

3. Create an event that spans two weeks eg.

4. [BUG] The event will not appear in the second week only the first week.

5. [FIX] The event appears as expected.
Yep, the option Show events spanning across midnight at the top bar seems to have also other buggy behavior - e.g. https://github.com/SimpleMobileTools/Simple-Calendar/issues/1767 .
Yep, the option
Show events spanning across midnight at the top barseems to have also other buggy behavior - e.g. #1767 .
@dumblob , PR 1837 should fix this, kindly test on your side too
@DoozyDoz wow, that fix looks good!
By any chance, do you or @tibbi have any CI regularly creating apks for PRs? I do not have Android studio available now so I would need a binary to test it. So far I noticed @Naveen3Singh is preparing such binaries only manually.
@tibbi did you forget this repo?
no, Im just always hesitant with such PRs :) They always fix one thing but break something else.
I have tested it quickly and it seems to work for me (but of course, there might be some edge cases which my regular calendars do not contain/exhibit).
Could you @tibbi also test it? Thanks!
Im getting a null pointer exception at line 574: y = currentEventWeeklyView!!.range.lower * minuteHeight
@DoozyDoz working on the crash?
@tibbi oh i had missed this, let me fix it
Hello @tibbi I have failed to reproduce the null pointer error, may I ask in which situation you got it?
I have an event from October 21, 23:00 to October 23, 23:00 and when I swipe to it, it crashes when I swipe to the week even starting with October 31. Try creating random long events, my weeks start on monday.
I have tried creating different long events (some spanning 2 weeks, others 3 weeks) I only get the error if i uncheck "Start week on Sunday" in settings Let me investigate and push a fix
Quick look that might help:
It crashes probably because the view was stored with a different key in the first loop, see https://github.com/SimpleMobileTools/Simple-Calendar/blob/af84b9a5af8288d825a569b8db24d248bcd67cc9/app/src/main/kotlin/com/simplemobiletools/calendar/pro/fragments/WeekFragment.kt#L451-L461
And startDayCode at line 574 now has a different day code after the proposed changes than the one on line 451. Both should be same.