snapshot of https://github.com/shadcn-ui/ui.git (main, 2026-09-15; blobs > 131072B omitted)
This commit is contained in:
23
apps/v4/examples/aria/calendar-range.tsx
Normal file
23
apps/v4/examples/aria/calendar-range.tsx
Normal file
@@ -0,0 +1,23 @@
|
||||
"use client"
|
||||
|
||||
import * as React from "react"
|
||||
import { CalendarDate } from "@internationalized/date"
|
||||
import { type DateRange } from "react-aria-components"
|
||||
|
||||
import { RangeCalendar } from "@/styles/aria-nova/ui/calendar"
|
||||
|
||||
export function CalendarRange() {
|
||||
const [dateRange, setDateRange] = React.useState<DateRange | undefined>({
|
||||
start: new CalendarDate(new Date().getFullYear(), 1, 12),
|
||||
end: new CalendarDate(new Date().getFullYear(), 1, 12).add({ days: 30 }),
|
||||
})
|
||||
|
||||
return (
|
||||
<RangeCalendar
|
||||
value={dateRange}
|
||||
onChange={setDateRange}
|
||||
numberOfMonths={2}
|
||||
className="rounded-lg border"
|
||||
/>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user