diff --git a/packages/ui/booker/DatePicker.tsx b/packages/ui/booker/DatePicker.tsx index e022d0f7ca..02beddd94c 100644 --- a/packages/ui/booker/DatePicker.tsx +++ b/packages/ui/booker/DatePicker.tsx @@ -6,6 +6,7 @@ import { useMemo, useState } from "react"; import classNames from "@calcom/lib/classNames"; import { daysInMonth, yyyymmdd } from "@calcom/lib/date-fns"; import { weekdayNames } from "@calcom/lib/weekday"; +import { SkeletonContainer } from "@calcom/ui/skeleton"; dayjs.extend(isToday); @@ -42,7 +43,7 @@ export const Day = ({ return ( + + ) : ( + { + props.onChange(day); + window.scrollTo({ + top: 360, + behavior: "smooth", + }); + }} + disabled={ + (includedDates && !includedDates.includes(yyyymmdd(day))) || + excludedDates.includes(yyyymmdd(day)) || + day.valueOf() < minDateValueOf + } + active={selected ? yyyymmdd(selected) === yyyymmdd(day) : false} + /> + )} + + ) + )} ); }; -const Spinner = () => ( - - - - -); - const DatePicker = ({ weekStart = 0, className, locale, selected, onMonthChange, - isLoading = false, ...passThroughProps }: DatePickerProps & Partial>) => { const [month, setMonth] = useState(selected ? selected.getMonth() : new Date().getMonth()); @@ -162,7 +159,6 @@ const DatePicker = ({ {new Date(new Date().setMonth(month)).getFullYear()}
- {isLoading && }