import { useId } from "react"; import type dayjs from "@calcom/dayjs"; import { useTimePreferences } from "@calcom/features/bookings/lib"; export const HorizontalLines = ({ hours, numberOfGridStopsPerCell, containerOffsetRef, }: { hours: dayjs.Dayjs[]; numberOfGridStopsPerCell: number; containerOffsetRef: React.RefObject; }) => { const { timeFormat } = useTimePreferences(); // We need to force the minute to zero, because otherwise in ex GMT+5.5, it would show :30 minute times (but at the positino of :00) const finalHour = hours[hours.length - 1].add(1, "hour").minute(0).format(timeFormat); const id = useId(); return (
{hours.map((hour) => (
{/* We need to force the minute to zero, because otherwise in ex GMT+5.5, it would show :30 minute times (but at the positino of :00) */} {hour.minute(0).format(timeFormat)}
))}
{finalHour}
); };