fix: check for overlapping appointments

This commit is contained in:
Paras Gupta 2021-05-10 02:28:05 +05:30
parent 640ea4031d
commit 3da430b577

View file

@ -144,6 +144,11 @@ export default function Type(props) {
if (dayjs(times[i]).isBetween(startTime, endTime)) {
times.splice(i, 1);
}
// Check if slot end time is between start and end time
if (dayjs(times[i]).add(props.eventType.length, 'minutes').isBetween(startTime, endTime)) {
times.splice(i, 1);
}
});
}