cal.pub0.org/apps/web/test/lib
Carina Wollendorfer 2f6b5ced04
fix: better slot starting times
## What does this PR do?

Currently, we start the first slot always at the nearest 15 minutes. This is not ideal as for some duration other slot starting time make more sense. So with this PR the starting times are defined as follow: 

- Frequency is exact hours (60, 120, 180, ...), slot start time is a full hour
- Frequency is half hours (30, 90, ...), slot start time is half or full hours (8:00, 8:30, ...)
- Same with 20-minute events (20, 40, ...) and 10-minute events 
- Everything else will start at the nearest 15 min slot

It also fixes that slot times are shifted when there is a busy slot with a different duration. Here is a before and after of a 30-min event with a 5-minute busy slot at 1:00 pm

Before: 
![Screenshot 2023-07-07 at 13 31 45](https://github.com/calcom/cal.com/assets/30310907/b92d4ff4-49f1-48f4-a973-99266f61d919)

After
![Screenshot 2023-07-07 at 13 34 01](https://github.com/calcom/cal.com/assets/30310907/042c7ef7-8c2a-4cd9-b663-183bc07b5864)


#### 30 Minute events, availability starting at 7:15

Before: 
![Screenshot 2023-07-06 at 12 40 00](https://github.com/calcom/cal.com/assets/30310907/752ed978-83cf-4ee9-a38d-b5795df6daec)

After:
![Screenshot 2023-07-06 at 12 40 42](https://github.com/calcom/cal.com/assets/30310907/5d51ec15-5be8-4f3b-b374-46dad35216b8)

## Type of change
- Bug fix (non-breaking change which fixes an issue)

## How should this be tested?

- Check if slot times are shown as described
- Test with different intervals/durations
- Test with busy times
- Test with different availabilities 

## Mandatory Tasks

- [x] Make sure you have self-reviewed the code. A decent size PR without self-review might be rejected.
2023-07-10 15:32:26 -07:00
..
availabilityAsString.test.ts chore: Added unit tests for converting availability to string (#9617) 2023-06-22 22:19:50 +00:00
checkBookingLimits.test.ts refactor: Moving from jest to vitest (#9035) 2023-05-24 23:35:44 +00:00
checkDurationLimits.test.ts refactor: Moving from jest to vitest (#9035) 2023-05-24 23:35:44 +00:00
getAggregateWorkingHours.test.ts test: Remove mockdate and replate with vitest system time (#9750) 2023-06-23 16:10:43 +00:00
getAvailabilityFromSchedule.test.ts test: Remove mockdate and replate with vitest system time (#9750) 2023-06-23 16:10:43 +00:00
getSchedule.test.ts fix: better slot starting times 2023-07-10 15:32:26 -07:00
getTimezone.test.ts fix: Change Detroit to New York as a default for EST time zone (#8218) 2023-05-29 19:57:34 +01:00
getWorkingHours.test.ts test: Remove mockdate and replate with vitest system time (#9750) 2023-06-23 16:10:43 +00:00
handleChildrenEventTypes.test.ts chore: fix all Typescript warnings (#8618) 2023-06-06 11:59:57 +00:00
next-config.test.ts fix: 404 booking pages when org support is enabled locally 2023-07-10 12:19:33 -07:00
parseZone.test.ts refactor: Moving from jest to vitest (#9035) 2023-05-24 23:35:44 +00:00
team-event-types.test.ts refactor: Moving from jest to vitest (#9035) 2023-05-24 23:35:44 +00:00