c-calendar-21.tsx
"use client"
import { useState } from "react"
import type { DateRange } from "react-day-picker"
import { Calendar } from "@/components/ui/calendar"
import { Card, CardContent } from "@/components/ui/card"
const now = new Date()
const year = now.getFullYear()
const month = now.getMonth()
const endOfMonth = new Date(year, month + 1, 0).getDate()
const from = new Date(year, month, Math.min(6, endOfMonth))
const to = new Date(year, month, Math.min(18, endOfMonth))
export function Pattern() {
const [date, setDate] = useState<DateRange | undefined>({
from,
to,
})
return (
<Card className="p-0">
<CardContent className="p-0">
<Calendar
mode="range"
numberOfMonths={2}
onSelect={setDate}
selected={date}
/>
</CardContent>
</Card>
)
}
































