2f6b5ced04
## 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. |
||
---|---|---|
.. | ||
lib | ||
.env.test.example | ||
README.md | ||
docker-compose.yml | ||
jest-resolver.js | ||
jest-setup.js |
README.md
Unit and Integration Tests
Make sure you have copied .env.test.example to .env.test
You can run all jest tests as
yarn test
You can run tests matching specific description by following command
yarn test -t getSchedule
Tip: Use --watchAll
flag to run tests on every change