Spaces:
Running
Running
gpt-engineer-app[bot]
commited on
Commit
·
3e3e154
1
Parent(s):
bfa7245
Fix: Hide outside month days
Browse filesThe calendar was displaying days from outside the current month. This commit addresses this issue.
src/components/ui/calendar.tsx
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
|
|
| 1 |
import * as React from "react";
|
| 2 |
import { ChevronLeft, ChevronRight } from "lucide-react";
|
| 3 |
import { DayPicker } from "react-day-picker";
|
|
@@ -10,7 +11,7 @@ export type CalendarProps = React.ComponentProps<typeof DayPicker>;
|
|
| 10 |
function Calendar({
|
| 11 |
className,
|
| 12 |
classNames,
|
| 13 |
-
showOutsideDays =
|
| 14 |
...props
|
| 15 |
}: CalendarProps) {
|
| 16 |
return (
|
|
@@ -34,7 +35,7 @@ function Calendar({
|
|
| 34 |
head_cell:
|
| 35 |
"text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",
|
| 36 |
row: "flex w-full mt-2",
|
| 37 |
-
cell: "h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected]
|
| 38 |
day: cn(
|
| 39 |
buttonVariants({ variant: "ghost" }),
|
| 40 |
"h-9 w-9 p-0 font-normal aria-selected:opacity-100"
|
|
@@ -44,7 +45,7 @@ function Calendar({
|
|
| 44 |
"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",
|
| 45 |
day_today: "bg-accent text-accent-foreground",
|
| 46 |
day_outside:
|
| 47 |
-
"
|
| 48 |
day_disabled: "text-muted-foreground opacity-50",
|
| 49 |
day_range_middle:
|
| 50 |
"aria-selected:bg-accent aria-selected:text-accent-foreground",
|
|
|
|
| 1 |
+
|
| 2 |
import * as React from "react";
|
| 3 |
import { ChevronLeft, ChevronRight } from "lucide-react";
|
| 4 |
import { DayPicker } from "react-day-picker";
|
|
|
|
| 11 |
function Calendar({
|
| 12 |
className,
|
| 13 |
classNames,
|
| 14 |
+
showOutsideDays = false,
|
| 15 |
...props
|
| 16 |
}: CalendarProps) {
|
| 17 |
return (
|
|
|
|
| 35 |
head_cell:
|
| 36 |
"text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",
|
| 37 |
row: "flex w-full mt-2",
|
| 38 |
+
cell: "h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",
|
| 39 |
day: cn(
|
| 40 |
buttonVariants({ variant: "ghost" }),
|
| 41 |
"h-9 w-9 p-0 font-normal aria-selected:opacity-100"
|
|
|
|
| 45 |
"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",
|
| 46 |
day_today: "bg-accent text-accent-foreground",
|
| 47 |
day_outside:
|
| 48 |
+
"hidden",
|
| 49 |
day_disabled: "text-muted-foreground opacity-50",
|
| 50 |
day_range_middle:
|
| 51 |
"aria-selected:bg-accent aria-selected:text-accent-foreground",
|