Skip to main content

date

Pivot date that drives the calendar's visible range. The active view derives its window from this value - the day, the week containing it, the month containing it, and so on.

Usage

date?: Date;

Default: new Date() (current date).

Example

<script lang="ts">
import { Calendar } from "@svar-ui/svelte-calendar";

const date = new Date(2025, 4, 12);
</script>

<Calendar {events} {date} view="week" />
  • view — pick the active view that consumes this date.
  • navigate-to — programmatic equivalent (jump to a date and/or view).
  • navigate-time — step by one range or jump to today.
  • Navigation Bar — toolbar wiring around the visible date.