Docs
Range Calendar
Range Calendar
A calendar component that allows users to select a range of dates.
Loading...
<script lang="ts">
import { RangeCalendar } from "$lib/components/ui/range-calendar";
import { today, getLocalTimeZone } from "@internationalized/date";
const start = today(getLocalTimeZone());
const end = start.add({ days: 7 });
let value = {
start,
end
};
</script>
<RangeCalendar bind:value class="border rounded-md shadow" />
<script lang="ts">
import { RangeCalendar } from "$lib/components/ui/range-calendar";
import { today, getLocalTimeZone } from "@internationalized/date";
const start = today(getLocalTimeZone());
const end = start.add({ days: 7 });
let value = {
start,
end
};
</script>
<RangeCalendar bind:value class="border rounded-md" />
About
The <RangeCalendar />
component is built on top of the Bits Range Calendar component, which uses the @internationalized/date package to handle dates.
Installation
npx shadcn-svelte@latest add range-calendar
On This Page