Skip to content
Theme:

Ui3nInputDate ​

Text input with a popover date picker. The outline-calendar-month icon in the append slot opens Ui3nDatePicker; the input displays and accepts a masked date (ISO by default).

v-model is a Date | null. The input shows YYYY-MM-DD; with show-timepicker the value becomes YYYY-MM-DD HH:mm[:ss] (YYYY-MM-DD hh:mm[:ss] A for the 12-hour format) and the panel renders the time block below the calendar.

input and change emit the displayed string, while update:modelValue emits only a valid Date or null when the field is cleared. Partial or non-existent dates (for example 2026-02-30) stay in the field without changing the model; use rules to report them. On blur, single-digit date and time parts are accepted.

The mask covers years 1900–9999. masked: false disables it, and timepickerConfig.leadingZeros: false disables the combined date-time mask because the format is no longer fixed. The panel stays open after a selection, preserves the time when a new date is chosen, and closes on an outside click.

format sets how the date is displayed and typed: YYYY-MM-DD (default), MM.DD.YYYY or DD.MM.YYYY. When placeholder is not passed, the input shows the format pattern.

without-year (supports v-model:without-year) switches the input to month and day only (MM.DD, DD.MM or MM-DD). The model is still a Date; its year is UI3N_NO_YEAR_REFERENCE (2000, a leap year, so February 29 is valid). allow-without-year renders a switch in the picker: toggling it emits update:withoutYear and converts the value (to the reference year, or back to the current year with February 29 clamped to February 28). If the parent changes without-year itself, convert the value with the exported convertDateForYearMode(date, withoutYear). The mode is ignored together with show-timepicker.

Props

NameTypeDefaultDescription
idstring | undefined —

Root element id

labelstring | undefined — No description provided
placeholderstring | undefined — No description provided
clearableboolean | undefined — No description provided
autofocusboolean | undefined — No description provided
readonlyboolean | undefined — No description provided
namestring | undefined — No description provided
rules((v: unknown) => string | boolean)[] | undefined — No description provided
validateAtStartupboolean | undefined — No description provided
hideBottomSpaceboolean | undefined — No description provided
displayStateMode"error" | "success" | undefined — No description provided
displayStateWithIconboolean | undefined — No description provided
displayStateMessagestring | undefined — No description provided
sizeUi3nDateTimePickerSize | undefined —

Component size

modelValue*Date | null —

Selected date or null

localeConfigUi3nDateTimeLocaleConfig | undefined —

Localized weekday, month and time-unit labels

firstDayOfWeek0 | 1 | undefined —

First day of the week: 0 (Sunday) or 1 (Monday)

showTimepickerboolean | undefined —

When true, the input displays and accepts a date with time (`YYYY-MM-DD HH:mm[:ss]`) and the picker renders the time block below the calendar.

timepickerConfigUi3nTimePickerConfig | undefined —

Time picker configuration used when `showTimepicker` is true

highlightWeekendsboolean | undefined —

Whether to highlight Saturdays and Sundays

disabledDaysstring[] | undefined —

ISO dates to disable (`YYYY-MM-DD`)

disabledboolean | undefined —

Whether the whole picker is disabled

maskedboolean | undefinedtrue

Whether to apply the date mask to the input.

formatUi3nDateFormat | undefined"YYYY-MM-DD"

Format used to display and type the date.

withoutYearboolean | undefinedfalse

"Without year" mode: only month and day are typed and displayed (e.g. `MM.DD`); the model value gets the `UI3N_NO_YEAR_REFERENCE` year. Supports `v-model:without-year`. Not supported together with `showTimepicker` (ignored in that case).

allowWithoutYearboolean | undefinedfalse

Whether the picker renders the "without year" switch.

Events

Event NameArguments / Value TypeDescription
update:modelValuevalue: Date | null —
clear —
initvalue: HTMLInputElement —
focusvalue: Event —
blurvalue: Event —
changevalue: string —
update:withoutYearvalue: boolean —
inputvalue: string —
keydownvalue: KeyboardEvent —
open-picker —
close-picker —
update:validvalue: boolean —

Public Methods & Exposes

Method NameSignature / TypeDescription
inputElement()HTMLInputElement | null | undefined

Reference to the input DOM element

isDirty()boolean | undefined

Whether the input has been modified

isFocused()boolean | undefined

Whether the input is currently focused

clearValue()(() => void) | undefined

Clear the input value

CSS Variables

Set any of these where you need it — on :root, on a container, or on the element itself through [data-ui3n] — and the component follows. Leave them alone and it uses the defaults below.

NameDefault
--ui3n-input-date-widthmax-content
--ui3n-input-date-z-index1000

Usage Examples ​

Basic usage ​

Binds a Date | null value and shows the masked ISO date in the input.

Basic usage

Date input bound to a Date value

Date and time ​

Enables the time picker below the calendar. The input switches to the date-time format and displays the selected time as well.

Date and time

Date-time input with a seconds-precision time picker

12-hour date-time ​

Uses the 12-hour format with AM/PM for both the input mask and the time picker.

12-hour date-time

Date-time input with a 12-hour time format

Validation and clearable ​

Passes rules to the input. Invalid text remains visible but does not update v-model; the rule reports the problem. Clearing emits null.

Validation and clearable

Rules validating the displayed date and a clear button

Localization, disabled days and weekends ​

Overrides weekday and month labels, starts the week on Monday, highlights weekends and disables selected ISO dates.

Localization, disabled days and weekends

Russian labels with disabled days and highlighted weekends

States and sizes ​

Shows the regular, large and disabled date inputs.

States and sizes

Regular, large and disabled date inputs

Date formats ​

format switches the input between YYYY-MM-DD, MM.DD.YYYY and DD.MM.YYYY. The mask, the placeholder and the parsing follow the format; v-model stays a Date.

Date formats

MM.DD.YYYY and DD.MM.YYYY inputs

Date without year ​

allow-without-year adds a switch to the picker, and v-model:without-year tracks it. In this mode only month and day are typed (MM.DD), the picker hides the year selector and weekdays, and the value has the UI3N_NO_YEAR_REFERENCE year.

Date without year

Birthday input that can omit the year