(react) extend Calendar functionalities with range selection

Extend the functionality of the DatePicker component to include support
for a range calendar. This enhancement allows users to select a date
range spanning multiple calendar cells, enabling more flexible date
selection.
This commit is contained in:
Lebaud Antoine
2023-06-15 16:05:37 +02:00
committed by aleb_the_flash
parent 219d08c82e
commit 3631367e14
2 changed files with 254 additions and 223 deletions

View File

@@ -7,12 +7,12 @@ import {
today,
} from "@internationalized/date";
import { useCalendarGrid } from "react-aria";
import { CalendarState } from "@react-stately/calendar";
import { CalendarState, RangeCalendarState } from "@react-stately/calendar";
import { CalendarCell } from ":/components/Forms/DatePicker/CalendarCell";
import { range } from ":/utils";
interface CalendarGridProps {
state: CalendarState;
state: CalendarState | RangeCalendarState;
defaultDaysInWeek?: number;
}