Reverted to commit 10950a4034

This commit is contained in:
gpt-engineer-app[bot]
2025-10-11 23:39:40 +00:00
parent c59ab9523f
commit 52e50ebb5e
8 changed files with 14 additions and 468 deletions

View File

@@ -4,20 +4,13 @@ import { DayPicker } from "react-day-picker";
import { cn } from "@/lib/utils";
import { buttonVariants } from "@/components/ui/button";
import { CustomCalendarCaption } from "@/components/ui/calendar-custom-caption";
export type CalendarProps = React.ComponentProps<typeof DayPicker> & {
enableYearGrid?: boolean;
};
export type CalendarProps = React.ComponentProps<typeof DayPicker>;
function Calendar({ className, classNames, showOutsideDays = true, enableYearGrid = false, ...props }: CalendarProps) {
const captionLayout = enableYearGrid ? undefined : (props.captionLayout || "dropdown-buttons");
function Calendar({ className, classNames, showOutsideDays = true, ...props }: CalendarProps) {
return (
<DayPicker
showOutsideDays={showOutsideDays}
captionLayout={captionLayout}
fromYear={props.fromYear || 1800}
toYear={props.toYear || new Date().getFullYear() + 10}
className={cn("p-3", className)}
classNames={{
months: "flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",
@@ -49,15 +42,6 @@ function Calendar({ className, classNames, showOutsideDays = true, enableYearGri
...classNames,
}}
components={{
Caption: enableYearGrid
? (captionProps) => (
<CustomCalendarCaption
{...captionProps}
fromYear={props.fromYear || 1800}
toYear={props.toYear || new Date().getFullYear() + 10}
/>
)
: undefined,
IconLeft: ({ ..._props }) => <ChevronLeft className="h-4 w-4" />,
IconRight: ({ ..._props }) => <ChevronRight className="h-4 w-4" />,
}}