| Su | Mo | Tu | We | Th | Fr | Sa |
|---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
<script lang="ts">
import { getLocalTimeZone, today } from "@internationalized/date";
import { RangeCalendar } from "$lib/components/ui/range-calendar/index.js";
const start = today(getLocalTimeZone());
const end = start.add({ days: 7 });
let value = $state({
start,
end
});
</script>
<RangeCalendar bind:value class="rounded-md border" /> 소개
<RangeCalendar /> 컴포넌트는 Bits Range Calendar 컴포넌트를 기반으로 구축되었으며, 날짜 처리를 위해 @internationalized/date 패키지를 사용합니다.
블록
30개 이상의 캘린더 블록에서 RangeCalendar 컴포넌트가 실제로 사용되는 것을 확인할 수 있습니다.
설치
bits-ui와 @internationalized/date를 설치하세요:
다음 코드를 프로젝트에 복사하여 붙여넣으세요.