Date Picker

An extended date picker component with time picker support.

Installation

npx shadcn-vue@latest add https://dsn-ui.pages.dev/r/dsn-date-picker.json

Usage

Basic Usage

A simple date-only picker with the default behavior.

Value: 2026-04-12

With Time Picker

Enable time selection and keep Monday as the first day of week.

Value: 2026-04-12T09:45:00.000Z

Year and Month Dropdown

Show dropdowns for month and year selection to improve navigation.

Value: undefined

With Date Boundaries

Restrict selectable dates by setting a minimum and maximum.

Value: 2026-04-16

With Custom Language Labels

Override default UI labels to match your product language.

Value: undefined

With Formatting Controls

Adjust date style and separator for date-time display.

Value: 2026-04-17T14:20:00.000Z

With Placeholder And Locale

Customize placeholder while keeping locale-aware formatting.

Value: undefined

With Clear Event

Listen to the clear event to trigger side effects when the user resets the date.

Value: 2026-04-12
Note: The calendar popover auto closed when the user selects a date in date-only mode. When time picker is enabled, the popover will stay open after date selection to allow time selection, and it can be closed by clicking the close button or clicking outside.

Props

PropTypeDescription
v-model

string | undefined

Default: undefined

Selected date value. Date-only mode emits YYYY-MM-DD, time mode can emit ISO datetime.

Example: 2026-04-12 or 2026-04-12T09:45:00.000Z

timePicker

boolean

Default: false

Show time controls below the calendar.

Example: true

minValue

string | Date | DateValue

Default: undefined

Minimum selectable date.

Example: 2026-04-10

maxValue

string | Date | DateValue

Default: undefined

Maximum selectable date.

Example: 2026-04-20

placeholder

string

Default: undefined

Custom placeholder for the trigger input.

Example: Select delivery date

layout

LayoutTypes

Default: undefined

Control month and year dropdown selector. Options: month-and-year | year-only | month-only.

Example: month-and-year

clearable

boolean

Default: false

Show clear actions for date and time.

Example: true

locale

string

Default: en-US

Locale used for date formatting and language key fallback. Any valid BCP 47 locale.

Example: id-ID

dateStyle

Intl.DateTimeFormatOptions['dateStyle']

Default: medium

Controls date formatting style. Possible values: full | long | medium | short.

Example: long

dateTimeSeparator

string

Default: -

Text between formatted date and selected time.

Example: |

weekStartsOn

WeekStartsOn

Default: 0

First day of week. Possible values: 0 | 1 | 2 | 3 | 4 | 5 | 6 (where 0 = Sunday and 1 = Monday).

Example: 1

lang

Partial<LangItems>

Default: undefined

Override internal labels for UI text. Keys: pick_date, clear_time, clear_date, select_time, close_date_picker, close_btn.

Example: { close_btn: "Tutup" }

Events

EventPayloadDescription
@clear

void

Triggered when the user clicks the clear button to reset the value.