Fixed bug that kept the date enabled when the time slot was less than 30m

This commit is contained in:
Alex van Andel committed 2021-06-30 15:41:38 +00:00
1 parent bfc7cce688
commit a28cb455f1
2 files changed
+10 -2

No files matched your search

+9 -2
View File
@@ -7,7 +7,14 @@ import getSlots from "@lib/slots";
dayjs.extend(utc);
dayjs.extend(timezone);
const DatePicker = ({ weekStart, onDatePicked, workingHours, organizerTimeZone, inviteeTimeZone }) => {
const DatePicker = ({
weekStart,
onDatePicked,
workingHours,
organizerTimeZone,
inviteeTimeZone,
eventLength,
}) => {
const [calendar, setCalendar] = useState([]);
const [selectedMonth, setSelectedMonth]: number = useState();
const [selectedDate, setSelectedDate]: Dayjs = useState();
@@ -43,7 +50,7 @@ const DatePicker = ({ weekStart, onDatePicked, workingHours, organizerTimeZone,
date.endOf("day").isBefore(dayjs().tz(inviteeTimeZone)) ||
!getSlots({
inviteeDate: date,
frequency: 30,
frequency: eventLength,
workingHours,
organizerTimeZone,
}).length