calendar icon indicating copy to clipboard operation
calendar copied to clipboard

fix(freebusy): time zone handling

Open st3iny opened this issue 11 months ago • 1 comments

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

  1. Disable the "find a time" button for recurring all day events. (They can't be converted into regular events so it makes no sense.)
  2. 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.)
  3. 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.
  4. Use the user's configured time zone to format slot suggestions (and all other displayed dates).

How to reproduce time zone problems?

  1. Create an event (not all day).
  2. Configure some other time zone far away, e.g. something in North America.
  3. Invite someone and open the find a time modal.
  4. Watch the time and date conversion break.
    1. Slots are not formatted correctly according to the user's time zone.
    2. Selected time in the grid does not match the configured time in the event editor.
    3. Selecting some time, saving and returning to the editor will yield a completely different time in the event.

Obligatory meme to cope with reality

image

st3iny avatar Feb 10 '25 19:02 st3iny

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.

Files with missing lines Patch % Lines
src/components/Editor/FreeBusy/FreeBusy.vue 0.00% 15 Missing :warning:
src/views/ContactsMenuAvailability.vue 0.00% 3 Missing :warning:
src/views/EditSidebar.vue 0.00% 2 Missing :warning:
src/services/freeBusySlotService.js 88.88% 1 Missing :warning:
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.

codecov[bot] avatar Feb 10 '25 19:02 codecov[bot]