From a13df41bae9826b23c2a7ab7a6539aed83c3c699 Mon Sep 17 00:00:00 2001 From: Luke Vella Date: Sun, 13 Oct 2024 11:48:25 +0100 Subject: [PATCH] More fixes --- .../month-calendar/month-calendar.tsx | 38 +++++++++---------- .../src/components/participant-avatar-bar.tsx | 6 ++- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/apps/web/src/components/forms/poll-options-form/month-calendar/month-calendar.tsx b/apps/web/src/components/forms/poll-options-form/month-calendar/month-calendar.tsx index 166a3b104..9824e6384 100644 --- a/apps/web/src/components/forms/poll-options-form/month-calendar/month-calendar.tsx +++ b/apps/web/src/components/forms/poll-options-form/month-calendar/month-calendar.tsx @@ -34,8 +34,7 @@ import { } from "../../../../utils/date-time-utils"; import DateCard from "../../../date-card"; import { useHeadlessDatePicker } from "../../../headless-date-picker"; -import type { DateTimeOption } from ".."; -import type { DateTimePickerProps } from "../types"; +import type { DateTimeOption, DateTimePickerProps } from "../types"; import { formatDateWithoutTime, formatDateWithoutTz } from "../utils"; import TimePicker from "./time-picker"; @@ -127,7 +126,7 @@ const MonthCalendar: React.FunctionComponent = ({ {datepicker.days.map((day, i) => { return (
= ({ }, ); const newOptions: DateTimeOption[] = []; - Object.keys(optionsByDay).forEach( - (dateString) => { - times.forEach((time) => { - const start = - dateString + time.startTime; - newOptions.push({ - type: "timeSlot", - start: start, - duration, - end: dayjs(start) - .add(duration, "minutes") - .format("YYYY-MM-DDTHH:mm"), - }); + for (const dateString of Object.keys( + optionsByDay, + )) { + for (const time of times) { + const start = dateString + time.startTime; + newOptions.push({ + type: "timeSlot", + start: start, + duration, + end: dayjs(start) + .add(duration, "minutes") + .format("YYYY-MM-DDTHH:mm"), }); - }, - ); + } + } onChange(newOptions); }} > @@ -462,10 +460,10 @@ const MonthCalendar: React.FunctionComponent = ({
{datepicker.selection .sort((a, b) => a.getTime() - b.getTime()) - .map((selectedDate, i) => { + .map((selectedDate) => { return ( {participants.slice(0, visibleCount).map((participant, index) => ( - +
  • @@ -45,7 +45,9 @@ export const ParticipantAvatarBar = ({ {participants .slice(visibleCount, 10) .map((participant, index) => ( -
  • {participant.name}
  • +
  • + {participant.name} +
  • ))}