Skip to content

Commit

Permalink
fixed slots availability by fixing buffertime (#3756)
Browse files Browse the repository at this point in the history
Co-authored-by: Peer Richelsen <peeroke@gmail.com>
  • Loading branch information
2 people authored and joeauyeung committed Aug 26, 2022
1 parent ea0c329 commit 4bbfdbd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/trpc/server/routers/viewer/slots.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ const checkIfIsAvailable = ({
}

const slotEndTime = time.add(eventLength, "minutes").utc();
const slotStartTime = time.subtract(beforeBufferTime, "minutes").utc();
const slotStartTime = time.utc();

return busy.every((busyTime) => {
const startTime = dayjs.utc(busyTime.start);
const startTime = dayjs.utc(busyTime.start).subtract(beforeBufferTime, "minutes").utc();
const endTime = dayjs.utc(busyTime.end);

if (endTime.isBefore(slotStartTime) || startTime.isAfter(slotEndTime)) {
Expand Down

0 comments on commit 4bbfdbd

Please sign in to comment.