# createCalendar API

> Auto-generated API reference for `createCalendar` from @vuetify/v0 (Vuetify0).
> Source of truth: https://0.vuetifyjs.com/api/create-calendar

## Related

- https://0.vuetifyjs.com/composables/forms/create-calendar
- https://0.vuetifyjs.com/composables/plugins/use-date
- https://0.vuetifyjs.com/composables/forms/create-input

## Functions

### createCalendar

```ts
(options?: CalendarOptions<Z>) => CalendarContext
```

## Options

| Name | Type | Default | Required | Description |
|---|---|---|---|---|
| `adapter` | `DateAdapter<Z> \| undefined` | — | no | Date engine. Omit it to borrow an installed date plugin, or to use `V0PlainDateAdapter` when none is installed. An adapter you pass is not replaced, and its `firstDayOfWeek` is not written. |
| `namespace` | `string \| undefined` | `'v0:date'` | no | Namespace of an installed date plugin. |
| `month` | `MaybeRefOrGetter<string \| undefined>` | — | no | Visible month. `YYYY-MM`, or a day whose month is used. Omitted means the current month, clamped to `min` and `max`. A writable ref is written as `YYYY-MM` when the grid pages. Inside a component it is also written when `min` or `max` clamps the month it opened on. A day token stays while the page stays in that month. A getter or a readonly ref is not written. |
| `value` | `MaybeRefOrGetter<CalendarValue>` | — | no | Selected day, or `{ start, end }` in range mode. A ref is written back. A getter or a readonly ref is not. Inside a component, changing `mode` clears it. |
| `mode` | `MaybeRefOrGetter<CalendarMode> \| undefined` | `'single'` | no | `'single'` selects one day. `'range'` selects a start and an end. A ref or getter is read on each interaction. Inside a component, changing it clears the selection. |
| `min` | `MaybeRefOrGetter<string \| undefined>` | — | no | `YYYY-MM-DD`. Days before it are disabled. |
| `max` | `MaybeRefOrGetter<string \| undefined>` | — | no | `YYYY-MM-DD`. Days after it are disabled. |
| `disabled` | `MaybeRefOrGetter<CalendarDisabled> \| undefined` | `false` | no | `true` disables every day. An array of `YYYY-MM-DD` days disables those days. A function disables the days it returns true for. A bare function is the predicate and is called with the ISO day, not passed through `toValue`. Navigation still runs. |
| `readonly` | `MaybeRefOrGetter<boolean> \| undefined` | `false` | no | `select` and `unselect` no-op. Cells stay enabled, and paging still runs. |
| `firstDayOfWeek` | `MaybeRefOrGetter<number \| undefined>` | — | no | Week start. `0` is Sunday. A finite number wins and is not written onto the adapter. Omit it to follow the adapter, or an owned `locale`. |
| `fixedWeeks` | `MaybeRefOrGetter<boolean> \| undefined` | `false` | no | Pad the grid to six rows. |
| `mandatory` | `MaybeRefOrGetter<boolean> \| undefined` | `false` | no | In single mode, clicking the selected day again does not clear it. Another day still replaces it. `unselect()` no-ops. Range clicks ignore this. Nothing is selected until the caller selects a day. |
| `locale` | `MaybeRefOrGetter<string \| undefined>` | — | no | BCP 47 tag. Written onto the adapter only when this call constructs it, which moves the weekday columns and the month label. A borrowed adapter keeps its own locale. |
| `weekdayFormat` | `CalendarWeekdayFormat \| undefined` | `'narrow'` | no | Weekday column labels. |

## Methods

| Name | Type | Description |
|---|---|---|
| `select` | `(iso: string) => void` | Selects an in-month day that is not disabled. In single mode, a second click on that day clears it, unless `mandatory` is set. In range mode, a later click sets the end or starts a new range. |
| `unselect` | `() => void` | Clears the selection. No-ops when `mandatory` or `readonly` is set. |
| `today` | `() => void` | Pages to the current month and focuses today. Selects nothing. |
| `selectToday` | `() => void` | Focuses today and selects it when that day is allowed. |
| `next` | `() => void` | Page to the next month, clamped to `max`. |
| `prev` | `() => void` | Page to the previous month, clamped to `min`. |
| `step` | `(count: number) => void` | Page by whole months, clamped to `min` and `max`. |
| `goto` | `(value: string) => void` | `YYYY-MM` or `YYYY-MM-DD`. Pages and focuses. |
| `move` | `(unit: CalendarUnit, amount: number) => void` | Walks the focused day and pages when it leaves the month. A step past `min` or `max` lands on that wall. |
| `first` | `() => void` | Page to the `min` month. No-op when `min` is unset. |
| `last` | `() => void` | Page to the `max` month. No-op when `max` is unset. |

## Properties

| Name | Type | Description |
|---|---|---|
| `month` | `ComputedRef<CalendarMonth>` | The visible month. One object, not an array. |
| `weekdays` | `ComputedRef<string[]>` | Seven labels, rotated to the week start. |
| `label` | `ComputedRef<string>` | Localized month and year. Year 0 follows Intl, which numbers that year 1. |
| `anchor` | `Readonly<Ref<string, string>>` | `YYYY-MM`. |
| `focused` | `Readonly<Ref<string, string>>` | `YYYY-MM-DD` navigation follows. May sit on a disabled in-month day. |
| `value` | `Readonly<Ref<CalendarValue, CalendarValue>>` | ISO day, or `{ start, end }` in range mode. |
| `isFirst` | `Readonly<Ref<boolean, boolean>>` | At the `min` month, or the first representable month. |
| `isLast` | `Readonly<Ref<boolean, boolean>>` | At the `max` month, or the last representable month. |
