---
title: "DatePicker"
description: "An internationalized date picker component."
canonical_url: "https://nuxt.mhaibaraai.me/en/docs/components/date-picker"
---
# DatePicker

> An internationalized date picker component.

## Introduction

`MDatePicker` is an internationalized date picker built on `@internationalized/date` for timezone and locale handling. It supports single date, date range, and multiple date selection, with button trigger, clearable, and quick preset interactions.

> [!NOTE]
> See: https://ui.nuxt.com/docs/components/calendar
> 
> Built on Nuxt UI's Calendar component

> [!NOTE]
> See: https://react-spectrum.adobe.com/internationalized/date/index.html
> 
> Uses the 
> 
> @internationalized/date
> 
>  library for date handling, ensuring timezone safety and i18n support.

## Usage

The default button trigger displays the current date. Click to open the calendar panel and write the selected date to v-model:

```vue
<script setup lang="ts">
const value = ref("")
</script>

<template>
  <MDatePicker />
</template>
```

### `range` Date Range

`range` mode maintains `start` / `end` dates. `numberOfMonths` can display a dual-month calendar simultaneously:

```vue
<script setup lang="ts">
const value = ref("")
</script>

<template>
  <MDatePicker range :number-of-months="2" />
</template>
```

### `numberOfMonths` Number of Months

`numberOfMonths` controls the number of months displayed side by side in the popover, making cross-month selection easier:

```vue
<template>
  <MDatePicker :number-of-months="3" />
</template>
```

### `clearable` Clearable

`clearable` shows a clear entry when a value is set. Clicking it resets without opening the calendar:

```vue
<template>
  <MDatePicker clearable />
</template>
```

### `presets` Quick Presets

Setting `presets` to `default` automatically generates quick items like "Today", "This Week", "This Month" based on the current mode:

```vue
<template>
  <MDatePicker range presets="default" />
</template>
```

### `multiple` Multiple Date Selection

`multiple` mode saves multiple dates in an array. The button label can dynamically display the number of selected dates:

```vue
<template>
  <MDatePicker multiple :button-props='{"label":"Select multiple dates","color":"primary"}' />
</template>
```

### `buttonProps` Trigger Button

`buttonProps` is passed to the trigger button, allowing adjustment of label, color, variant, and icon:

```vue
<template>
  <MDatePicker :button-props='{"label":"Select birthday","color":"primary","variant":"outline","icon":"i-lucide-cake"}' />
</template>
```

## Examples

### Inheriting Field Context

When placed inside `UFormField`, it inherits `size` and error state, and the trigger button renders according to the form state:

```vue [ComponentsDatePickerFormFieldExample.vue]
<script setup lang="ts">
defineProps<{
  size: 'xs' | 'sm' | 'md' | 'lg' | 'xl'
}>()
</script>

<template>
  <UFormField label="预约日期" :size="size" error="示例错误态">
    <MDatePicker />
  </UFormField>
</template>
```

### Inside `UFieldGroup`

When placed alongside a button inside `UFieldGroup`, they share size and border connection — ideal for filter bars with shortcut actions:

```vue [ComponentsDatePickerFieldGroupExample.vue]
<script setup lang="ts">
defineProps<{
  size: 'xs' | 'sm' | 'md' | 'lg' | 'xl'
}>()
</script>

<template>
  <UFieldGroup :size="size">
    <MDatePicker />
    <UButton icon="i-lucide-calendar-check" color="neutral" variant="subtle" />
  </UFieldGroup>
</template>
```

### Constraining Selectable Date Boundaries

`minValue` and `maxValue` disable dates outside the boundary, restricting selection to future or past dates respectively:

```vue [ComponentsDatePickerValidationExample.vue]
<script setup lang="ts">
import type { CalendarDate } from '#movk/types'

const formatter = useDateFormatter()
const futureDate = shallowRef<CalendarDate>()
const pastDate = shallowRef<CalendarDate>()
</script>

<template>
  <div class="space-y-4">
    <UFormField label="未来日期">
      <MDatePicker
        v-model="futureDate"
        :min-value="formatter.getToday()"
        :button-props="{ label: '选择未来日期', class: 'w-full' }"
      />
    </UFormField>

    <UFormField label="过去日期">
      <MDatePicker
        v-model="pastDate"
        :max-value="formatter.getToday()"
        :button-props="{ label: '选择过去日期', class: 'w-full' }"
      />
    </UFormField>
  </div>
</template>
```

### Disabling Dates by Rule

`isDateUnavailable` disables dates according to business rules (e.g., weekends as shown in the example):

```vue [ComponentsDatePickerUnavailableExample.vue]
<script setup lang="ts">
import { CalendarDate } from '#movk/composables/useDateFormatter'
import type { DateValue } from '#movk/types'

const formatter = useDateFormatter()
const date = shallowRef(new CalendarDate(2025, 11, 18))

// 禁用周末
const isDateUnavailable = (date: DateValue) => {
  return formatter.isWeekend(date)
}
</script>

<template>
  <MDatePicker
    v-model="date"
    :is-date-unavailable="isDateUnavailable"
    :button-props="{ label: '仅工作日', class: 'w-full' }"
  />
</template>
```

### Custom Trigger Button Label

`labelFormat` receives formatting utilities and the current value to combine date and weekday info into the button label:

```vue [ComponentsDatePickerFormatExample.vue]
<script setup lang="ts">
import { CalendarDate } from '@internationalized/date'

const isoDate = shallowRef(new CalendarDate(2025, 11, 18))
const timestampDate = shallowRef(new CalendarDate(2025, 11, 18))
const customDate = shallowRef(new CalendarDate(2025, 11, 18))
</script>

<template>
  <div class="space-y-4">
    <UFormField label="ISO 格式">
      <MDatePicker v-model="isoDate" label-format="iso" :button-props="{ class: 'w-full' }" />
    </UFormField>

    <UFormField label="时间戳">
      <MDatePicker v-model="timestampDate" label-format="timestamp" :button-props="{ class: 'w-full' }" />
    </UFormField>

    <UFormField label="自定义">
      <MDatePicker
        v-model="customDate"
        :button-props="{ class: 'w-full' }"
        :label-format="(fmt, value) => {
          if (!value || !fmt.isDateValue(value)) return '选择日期'
          return `${fmt.format(value)} (星期${fmt.getDayOfWeek(value)})`
        }"
      />
    </UFormField>
  </div>
</template>
```

### Custom Quick Presets

Passing an array to `presets` allows business-rule-based date returns. Each item's `value` is a function that receives a `formatter`:

```vue [ComponentsDatePickerPresetsExample.vue]
<script setup lang="ts">
import type { DateValue } from '@movk/nuxt'

const value = shallowRef<DateValue>()
</script>

<template>
  <MDatePicker
    v-model="value"
    placeholder="选择日期"
    :presets="[
      { label: '本周一', value: f => f.getStartOfWeek(f.getToday()) as DateValue },
      { label: '本月初', value: f => f.getStartOfMonth(f.getToday()) as DateValue },
      { label: '本年初', value: f => f.getStartOfYear(f.getToday()) as DateValue }
    ]"
  />
</template>
```

## useDateFormatter

### Usage

Use the auto-imported `useDateFormatter` composable for date formatting, conversion and manipulation, built on the `@internationalized/date` library for internationalized date handling.

```vue
<script setup lang="ts">
const formatter = useDateFormatter({ locale: 'en-US' })

const today = formatter.getToday()
const formattedDate = formatter.format(today)
// "Nov 29, 2025"

const isoString = formatter.toISO(today)
// "2025-11-29"
</script>
```

- `useDateFormatter` provides locale-aware date formatting based on `Intl.DateTimeFormat`.
- Supports bulk conversion of single dates, date ranges, date arrays and nested objects.
- Specify a timezone via the `timeZone` option (defaults to the local timezone); identifiers follow the IANA timezone database specification.

> [!NOTE]
> 
> All formatting and conversion methods have built-in error handling: passing 
> 
> null
> 
>  or 
> 
> undefined
> 
>  returns an empty string or 
> 
> null
> 
>  without throwing an exception.

### Capabilities at a Glance

The table below covers the output shapes of `useDateFormatter` across common date scenarios:

```vue [ComposablesUseDateFormatterOverviewExample.vue]
<script setup lang="ts">
const f = useDateFormatter({ locale: 'zh-CN' })
const today = f.getToday()
const range = { start: today, end: today.add({ days: 7 }) }
const list = [today, today.add({ days: 1 }), today.add({ days: 2 })]

const rows = [
  { method: 'format(today)', value: f.format(today) },
  { method: 'toISO(today)', value: f.toISO(today) },
  { method: 'toTimestamp(today)', value: f.toTimestamp(today) },
  { method: 'toUnixTimestamp(today)', value: f.toUnixTimestamp(today) },
  { method: 'isWeekend(today)', value: f.isWeekend(today) },
  { method: 'isWeekday(today)', value: f.isWeekday(today) },
  { method: 'isToday(today)', value: f.isToday(today) },
  { method: 'getDayOfWeek(today)', value: f.getDayOfWeek(today) },
  { method: 'getDayOfWeekName(today, "long")', value: f.getDayOfWeekName(today, 'long') },
  { method: 'getDayOfWeekName(today, "short")', value: f.getDayOfWeekName(today, 'short') },
  { method: 'getStartOfMonth(today)', value: f.toISO(f.getStartOfMonth(today)) },
  { method: 'getEndOfMonth(today)', value: f.toISO(f.getEndOfMonth(today)) },
  { method: 'getStartOfYear(today)', value: f.toISO(f.getStartOfYear(today)) },
  { method: 'getEndOfYear(today)', value: f.toISO(f.getEndOfYear(today)) },
  { method: 'formatRange(start, end)', value: f.formatRange(range.start, range.end) },
  { method: 'formatArray([d, d+1, d+2])', value: f.formatArray(list) },
  { method: 'parse("2026-01-01")?.toString()', value: f.parse('2026-01-01')?.toString() ?? 'null' }
]

const columns = [
  { accessorKey: 'method', header: '调用' },
  { accessorKey: 'value', header: '返回值' }
]
</script>

<template>
  <div class="flex flex-col gap-3">
    <p class="text-xs text-muted">
      当前 locale: {{ f.locale }} · timeZone: {{ f.timeZone }}
    </p>
    <MDataTable :columns="columns" :data="rows" stripe bordered density="compact" />
  </div>
</template>
```

### Integration with AutoForm

When using date fields in AutoForm, use `convertToISO()` for bulk conversion before submitting:

```vue
<script setup lang="ts">
const { afz } = useAutoForm()
const formatter = useDateFormatter()

const schema = afz.object({
  eventDate: afz.calendarDate(),
  eventRange: afz.calendarDate({
    controlProps: { mode: 'range' }
  })
})

const formData = ref()

async function handleSubmit() {
  // Automatically handle conversion for all date fields
  const payload = formatter.convertToISO(formData.value)

  // payload.eventDate: "2025-11-29"
  // payload.eventRange: { start: "2025-11-01", end: "2025-11-30" }

  await api.submit(payload)
}
</script>
```

> [!NOTE]
> 
> convertToISO
> 
>  automatically traverses all nested date fields while preserving the object structure — no manual conversion required.

### API

#### useDateFormatter()

`useDateFormatter(options?: DateFormatterOptions): DateFormatter`{lang="ts-type"}

Creates a date formatter instance.

##### Parameters

**options** (`DateFormatterOptions`): Date formatter configuration options.Locale. Defaults to the enclosing UApp locale, or 'en' outside a component.Date format options, following the Intl.DateTimeFormat specification. Defaults to { dateStyle: 'medium' }.Timezone identifier (e.g. 'Asia/Shanghai', 'America/New_York'). Defaults to the local timezone. See the @internationalized/date timezone docs.

##### Returns

Returns a date formatter object with the following methods and properties.

#### Formatting Methods

**format()** (`(date: DateValue | undefined | null) => string`): Format a single date as a localized string.formatter.format(date)
// "Nov 29, 2025"

**formatRange()** (`(start: DateValue | undefined | null, end: DateValue | undefined | null, separator?: string) => string`): Format a date range. Default separator is ' - '.formatter.formatRange(startDate, endDate)
// "Nov 1, 2025 - Nov 30, 2025"

formatter.formatRange(startDate, endDate, ' to ')
// "Nov 1, 2025 to Nov 30, 2025"

**formatArray()** (`(dates: DateValue[] | undefined | null, separator?: string) => string`): Format an array of dates. Default separator is ', '.formatter.formatArray([date1, date2, date3])
// "Nov 1, 2025, Nov 15, 2025, Nov 29, 2025"

#### Conversion Methods

**toISO()** (`(date: DateValue | undefined | null) => string`): Convert to an ISO 8601 string.formatter.toISO(date)
// "2025-11-29"

**toDate()** (`(date: DateValue | undefined | null) => Date | null`): Convert to a JavaScript Date object.

**toTimestamp()** (`(date: DateValue | undefined | null) => number | null`): Convert to a timestamp (milliseconds).formatter.toTimestamp(date)
// 1732838400000

**toUnixTimestamp()** (`(date: DateValue | undefined | null) => number | null`): Convert to a Unix timestamp (seconds).formatter.toUnixTimestamp(date)
// 1732838400

**parse()** (`(value: string) => DateValue | null`): Parse an ISO 8601 date string. Automatically identifies CalendarDate, CalendarDateTime or ZonedDateTime.formatter.parse('2025-11-29')
// CalendarDate

formatter.parse('2025-11-29T10:30:00')
// CalendarDateTime

formatter.parse('2025-11-29T10:30:00[Asia/Shanghai]')
// ZonedDateTime

#### Utility Methods — Getting Dates

**getToday()** (`() => CalendarDate`): Get today's date.

**getNow()** (`() => ZonedDateTime`): Get the current date and time.

**getStartOfWeek()** (`(date: DateValue) => DateValue`): Get the start of the week (based on the current locale).

**getEndOfWeek()** (`(date: DateValue) => DateValue`): Get the end of the week (based on the current locale).

**getStartOfMonth()** (`(date: DateValue) => DateValue`): Get the start of the month.

**getEndOfMonth()** (`(date: DateValue) => DateValue`): Get the end of the month.

**getStartOfYear()** (`(date: DateValue) => DateValue`): Get the start of the year.

**getEndOfYear()** (`(date: DateValue) => DateValue`): Get the end of the year.

#### Utility Methods — Queries

**getDayOfWeek()** (`(date: DateValue) => number`): Get the day of the week as a number (0–6, where 0 is the localized first day of the week).

**getDayOfWeekName()** (`(date: DateValue, style?: 'narrow' | 'short' | 'long') => string`): Get the localized name of the day of the week.ParametersDate object.Format style. Defaults to long.'narrow' — Shortest format, e.g. "M"'short' — Short format, e.g. "Mon"'long' — Full format, e.g. "Monday"const date = formatter.getToday()

formatter.getDayOfWeekName(date, 'narrow')  // "M"
formatter.getDayOfWeekName(date, 'short')   // "Mon"
formatter.getDayOfWeekName(date, 'long')    // "Monday"
formatter.getDayOfWeekName(date)            // "Monday" (default)

**getWeeksInMonth()** (`(date: DateValue) => number`): Get the number of weeks in the month.

**isWeekday()** (`(date: DateValue) => boolean`): Check whether the date is a weekday.

**isWeekend()** (`(date: DateValue) => boolean`): Check whether the date is a weekend day.

**isSameDay()** (`(a: DateValue, b: DateValue) => boolean`): Check whether two dates are the same day.

**isSameMonth()** (`(a: DateValue, b: DateValue) => boolean`): Check whether two dates are in the same month.

**isSameYear()** (`(a: DateValue, b: DateValue) => boolean`): Check whether two dates are in the same year.

**isToday()** (`(date: DateValue) => boolean`): Check whether the date is today.

**isDateValue()** (`(value: unknown) => value is DateValue`): Type guard: check whether a value is a DateValue.

**isDateRange()** (`(value: unknown) => value is DateRange`): Type guard: check whether a value is a DateRange.

#### Bulk Conversion Methods

**convertData()** (`<T>(data: T, converter: (value: DateValue) => any) => T`): Generic data conversion function. Automatically handles single dates, date ranges, date arrays and nested objects.const converted = formatter.convertData(complexData, formatter.toISO)

**convertToISO()** (`<T>(data: T) => T`): Bulk convert to ISO strings. Supports single dates, date ranges, arrays and nested objects.// Single date
formatter.convertToISO(date)
// "2025-11-29"

// Date range
formatter.convertToISO({ start: date1, end: date2 })
// { start: "2025-11-01", end: "2025-11-30" }

// Date array
formatter.convertToISO([date1, date2])
// ["2025-11-01", "2025-11-15"]

// Nested object
formatter.convertToISO({
  createdAt: date1,
  range: { start: date2, end: date3 }
})
// {
//   createdAt: "2025-11-01",
//   range: { start: "2025-11-20", end: "2025-11-29" }
// }

**convertToFormatted()** (`<T>(data: T) => T`): Bulk convert to formatted strings.

**convertToDate()** (`<T>(data: T) => T`): Bulk convert to Date objects.

#### Configuration Properties

**locale** (`string`): The current locale in use.

**timeZone** (`string`): The current timezone in use.

### Changelog

See commit history for [src/runtime/composables/datePicker.ts](https://github.com/mhaibaraai/movk-nuxt/commits/main/src/runtime/composables/datePicker.ts).

### Calendar Visibility

`v-model:open` tracks the popover state. Use the exposed `open()` and `close()` methods to update it. The legacy `popoverProps.open` applies when there is no top-level value. `popoverProps.defaultOpen` initializes uncontrolled state.

```vue [ComponentsDatePickerOpenExample.vue]
<script setup lang="ts">
const open = ref(false)
const picker = useTemplateRef('picker')
</script>

<template>
  <div class="flex flex-wrap items-center gap-2">
    <UButton label="Open calendar" @click="picker?.open()" />
    <MDatePicker ref="picker" v-model:open="open" />
    <UButton label="Close calendar" variant="outline" @click="picker?.close()" />
  </div>
</template>
```

## API

### Props

```ts
/**
 * Props for the MDatePicker component
 */
interface MDatePickerProps {
  id?: string | undefined;
  name?: string | undefined;
  /**
   * 同时作用于触发按钮与日历，缺省时继承 UFormField / UFieldGroup
   */
  size?: "xs" | "sm" | "md" | "lg" | "xl" | undefined;
  /**
   * 日历主色；处于表单错误态时触发按钮显示为 error
   */
  color?: "primary" | "secondary" | "info" | "success" | "warning" | "error" | "important" | "neutral" | undefined;
  disabled?: boolean | undefined;
  /**
   * 未选择时的按钮文本，缺省时依次取 `buttonProps.label`、locale 的 `datePicker.placeholder`
   */
  placeholder?: string | undefined;
  buttonProps?: ButtonProps | undefined;
  popoverProps?: PopoverProps<P> | undefined;
  /**
   * @default 'formatted'
   */
  labelFormat?: "iso" | "timestamp" | "unix" | "date" | "formatted" | (formatter: { format: (date: Nullable<DateValue>) => string; formatRange: (start: Nullable<DateValue>, end: Nullable<DateValue>, separator?: string) => string; ... 38 more ...; timeZone: string; }, modelValue: CalendarModelValue<...> | undefined): string | undefined;
  /**
   * v-model 投影输出格式
   * @default 'date-value'
   */
  valueFormat?: V | undefined;
  clearable?: boolean | undefined;
  /**
   * 快捷预设
   */
  presets?: "default" | DatePickerPreset<R, M>[] | undefined;
  ui?: Record<string, c> & { content?: SlotClass; arrow?: SlotClass; wrapper?: SlotClass; presets?: SlotClass; presetButton?: SlotClass; calendar?: SlotClass; clearIcon?: SlotClass; } | undefined;
  /**
   * 语言区域，缺省时跟随 `<UApp :locale>`，组件外调用时为 `'en'`
   */
  locale?: string | undefined;
  /**
   * 日期格式化选项
   */
  formatOptions?: Intl.DateTimeFormatOptions | undefined;
  /**
   * 时区标识符,默认使用本地时区
   */
  timeZone?: string | undefined;
  /**
   * The element or component this component should render as.
   * @default 'div'
   */
  as?: any;
  /**
   * The type of picker.
   * - `date` renders a day calendar whose heading can switch to a month then year view.
   * - `month` renders a standalone month picker.
   * - `year` renders a standalone year picker.
   * @default 'date'
   */
  type?: "date" | "month" | "year" | undefined;
  /**
   * The icon to use for the next year control.
   * @default appConfig.ui.icons.chevronDoubleRight
   */
  nextYearIcon?: any;
  /**
   * Configure the next year button.
   * `{ color: 'neutral', variant: 'ghost' }`{lang="ts-type"}
   */
  nextYear?: Omit<ButtonProps, LinkPropsKeys> | undefined;
  /**
   * The icon to use for the next month control.
   * @default appConfig.ui.icons.chevronRight
   */
  nextMonthIcon?: any;
  /**
   * Configure the next month button.
   * `{ color: 'neutral', variant: 'ghost' }`{lang="ts-type"}
   */
  nextMonth?: Omit<ButtonProps, LinkPropsKeys> | undefined;
  /**
   * The icon to use for the previous year control.
   * @default appConfig.ui.icons.chevronDoubleLeft
   */
  prevYearIcon?: any;
  /**
   * Configure the prev year button.
   * `{ color: 'neutral', variant: 'ghost' }`{lang="ts-type"}
   */
  prevYear?: Omit<ButtonProps, LinkPropsKeys> | undefined;
  /**
   * The icon to use for the previous month control.
   * @default appConfig.ui.icons.chevronLeft
   */
  prevMonthIcon?: any;
  /**
   * Configure the prev month button.
   * `{ color: 'neutral', variant: 'ghost' }`{lang="ts-type"}
   */
  prevMonth?: Omit<ButtonProps, LinkPropsKeys> | undefined;
  /**
   * Whether to make the heading a button that switches between the day, month and year views.
   * Has no effect when `type` is `year`. Can be an object to override the button props.
   * `{ color: 'neutral', variant: 'ghost', block: true }`{lang="ts-type"}
   * @default true
   */
  viewControl?: boolean | Omit<ButtonProps, LinkPropsKeys> | undefined;
  /**
   * @default 'solid'
   */
  variant?: "solid" | "outline" | "soft" | "subtle" | undefined;
  /**
   * Whether or not a range of dates can be selected
   */
  range?: R | undefined;
  /**
   * Whether or not multiple dates can be selected
   */
  multiple?: M | undefined;
  /**
   * Show month controls
   */
  monthControls?: boolean | undefined;
  /**
   * Show year controls
   */
  yearControls?: boolean | undefined;
  defaultValue?: CalendarDefaultValue<R, M> | undefined;
  weekNumbers?: boolean | undefined;
  /**
   * The default placeholder date
   */
  defaultPlaceholder?: CalendarDate | CalendarDateTime | ZonedDateTime | undefined;
  /**
   * When combined with `isDateUnavailable`, determines whether non-contiguous ranges, i.e. ranges containing unavailable dates, may be selected.
   */
  allowNonContiguousRanges?: boolean | undefined;
  /**
   * This property causes the previous and next buttons to navigate by the number of months displayed at once, rather than one month
   */
  pagedNavigation?: boolean | undefined;
  /**
   * Whether or not to prevent the user from deselecting a date without selecting another date first
   */
  preventDeselect?: boolean | undefined;
  /**
   * The maximum number of days that can be selected in a range
   */
  maximumDays?: number | undefined;
  /**
   * The day of the week to start the calendar on
   */
  weekStartsOn?: 0 | 1 | 2 | 4 | 5 | 3 | 6 | undefined;
  /**
   * The format to use for the weekday strings provided via the weekdays slot prop
   */
  weekdayFormat?: "narrow" | "short" | "long" | undefined;
  /**
   * Whether or not to always display 6 weeks in the calendar
   */
  fixedWeeks?: boolean | undefined;
  /**
   * The maximum date that can be selected
   */
  maxValue?: CalendarDate | CalendarDateTime | ZonedDateTime | undefined;
  /**
   * The minimum date that can be selected
   */
  minValue?: CalendarDate | CalendarDateTime | ZonedDateTime | undefined;
  /**
   * The number of months to display at once
   */
  numberOfMonths?: number | undefined;
  /**
   * Whether or not the calendar is readonly
   */
  readonly?: boolean | undefined;
  /**
   * If true, the calendar will focus the selected day, today, or the first day of the month depending on what is visible when the calendar is mounted
   */
  initialFocus?: boolean | undefined;
  /**
   * A function that returns whether or not a date is disabled
   */
  isDateDisabled?: (date: DateValue): boolean | undefined;
  /**
   * A function that returns whether or not a date is unavailable
   */
  isDateUnavailable?: (date: DateValue): boolean | undefined;
  /**
   * A function that returns whether or not a date is hightable
   */
  isDateHighlightable?: (date: DateValue): boolean | undefined;
  /**
   * A function that returns the next page of the calendar. It receives the current placeholder as an argument inside the component.
   */
  nextPage?: (placeholder: DateValue): DateValue | undefined;
  /**
   * A function that returns the previous page of the calendar. It receives the current placeholder as an argument inside the component.
   */
  prevPage?: (placeholder: DateValue): DateValue | undefined;
  /**
   * Whether or not to disable days outside the current view.
   */
  disableDaysOutsideCurrentView?: boolean | undefined;
  /**
   * Which part of the range should be fixed
   */
  fixedDate?: "start" | "end" | undefined;
  /**
   * A function that returns whether or not a month is disabled
   */
  isMonthDisabled?: (date: DateValue): boolean | undefined;
  /**
   * A function that returns whether or not a month is unavailable
   */
  isMonthUnavailable?: (date: DateValue): boolean | undefined;
  /**
   * A function that returns whether or not a year is disabled
   */
  isYearDisabled?: (date: DateValue): boolean | undefined;
  /**
   * A function that returns whether or not a year is unavailable
   */
  isYearUnavailable?: (date: DateValue): boolean | undefined;
  /**
   * Number of years to display per page
   */
  yearsPerPage?: number | undefined;
  modelValue?: FormattedValue<R, M, V> | undefined;
  /**
   * @default undefined
   */
  open?: boolean | undefined;
}
```

### Emits

```ts
/**
 * Emitted events for the MDatePicker component
 */
interface MDatePickerEmits {
  close:prevent: (payload: []) => void;
  update:modelValue: (payload: [value: FormattedValue<R, M, V>]) => void;
  update:placeholder: (payload: [date: DateValue]) => void;
  update:validModelValue: (payload: [date: DateRange]) => void;
  update:startValue: (payload: [date: DateValue | undefined]) => void;
  update:open: (payload: [value: boolean | undefined]) => void;
  update:modelValue: (payload: [value: FormattedValue<R, M, V> | undefined]) => void;
}
```

### Slots

```ts
/**
 * Slots for the MDatePicker component
 */
interface MDatePickerSlots {
  default(): any;
  content(): any;
  heading(): any;
  day(): any;
  week-day(): any;
  month-cell(): any;
  year-cell(): any;
  leading(): any;
  trailing(): any;
}
```

## Theme

::component-theme
::

## Changelog

See commit history for [src/runtime/components/DatePicker.vue](https://github.com/mhaibaraai/movk-nuxt/commits/main/src/runtime/components/DatePicker.vue).


## Sitemap

See the full [sitemap](https://nuxt.mhaibaraai.me/sitemap.md) for all pages.
