calendar
calendar copied to clipboard
fix(freebusy): time zone handling
Fix https://github.com/nextcloud/calendar/issues/6702
This PR fixes an array of issues in the time zone handling and slot suggestion logic of the free busy or "find a time" modal.
Fixes
- Disable the "find a time" button for recurring all day events. (They can't be converted into regular events so it makes no sense.)
- Disable slot suggestion for all day events until the user manually selects a slot in the grid. Again, it doesn't make sense to find a time for an all day event. (There will be a hint/help message instead of the automatic slot suggestion.)
- Handle time zones correctly. Use the event's start and end time zones. Convert everything to the user's configured time zone to be consistent with the calendar grid.
- Use the user's configured time zone to format slot suggestions (and all other displayed dates).
How to reproduce time zone problems?
- Create an event (not all day).
- Configure some other time zone far away, e.g. something in North America.
- Invite someone and open the find a time modal.
- Watch the time and date conversion break.
- Slots are not formatted correctly according to the user's time zone.
- Selected time in the grid does not match the configured time in the event editor.
- Selecting some time, saving and returning to the editor will yield a completely different time in the event.
Obligatory meme to cope with reality
Codecov Report
Attention: Patch coverage is 27.58621% with 21 lines in your changes missing coverage. Please review.
Project coverage is 22.95%. Comparing base (
7b81283) to head (a1adebc). Report is 11 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #6703 +/- ##
============================================
- Coverage 23.02% 22.95% -0.07%
Complexity 475 475
============================================
Files 252 252
Lines 12101 12130 +29
Branches 2307 2318 +11
============================================
- Hits 2786 2785 -1
- Misses 8989 9019 +30
Partials 326 326
| Flag | Coverage Δ | |
|---|---|---|
| javascript | 14.50% <27.58%> (-0.06%) |
:arrow_down: |
| php | 59.30% <ø> (ø) |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.