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
| Name | Type | Default | Description |
|---|---|---|---|
id | string | undefined | — | Root element id |
label | string | undefined | — | No description provided |
placeholder | string | undefined | — | No description provided |
clearable | boolean | undefined | — | No description provided |
autofocus | boolean | undefined | — | No description provided |
readonly | boolean | undefined | — | No description provided |
name | string | undefined | — | No description provided |
rules | ((v: unknown) => string | boolean)[] | undefined | — | No description provided |
validateAtStartup | boolean | undefined | — | No description provided |
hideBottomSpace | boolean | undefined | — | No description provided |
displayStateMode | "error" | "success" | undefined | — | No description provided |
displayStateWithIcon | boolean | undefined | — | No description provided |
displayStateMessage | string | undefined | — | No description provided |
size | Ui3nDateTimePickerSize | undefined | — | Component size |
modelValue* | Date | null | — | Selected date or null |
localeConfig | Ui3nDateTimeLocaleConfig | undefined | — | Localized weekday, month and time-unit labels |
firstDayOfWeek | 0 | 1 | undefined | — | First day of the week: 0 (Sunday) or 1 (Monday) |
showTimepicker | boolean | 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. |
timepickerConfig | Ui3nTimePickerConfig | undefined | — | Time picker configuration used when `showTimepicker` is true |
highlightWeekends | boolean | undefined | — | Whether to highlight Saturdays and Sundays |
disabledDays | string[] | undefined | — | ISO dates to disable (`YYYY-MM-DD`) |
disabled | boolean | undefined | — | Whether the whole picker is disabled |
masked | boolean | undefined | true | Whether to apply the date mask to the input. |
format | Ui3nDateFormat | undefined | "YYYY-MM-DD" | Format used to display and type the date. |
withoutYear | boolean | undefined | false | "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). |
allowWithoutYear | boolean | undefined | false | Whether the picker renders the "without year" switch. |
Events
| Event Name | Arguments / Value Type | Description |
|---|---|---|
update:modelValue | value: Date | null | — |
clear | | — |
init | value: HTMLInputElement | — |
focus | value: Event | — |
blur | value: Event | — |
change | value: string | — |
update:withoutYear | value: boolean | — |
input | value: string | — |
keydown | value: KeyboardEvent | — |
open-picker | | — |
close-picker | | — |
update:valid | value: boolean | — |
Public Methods & Exposes
| Method Name | Signature / Type | Description |
|---|---|---|
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.
| Name | Default |
|---|---|
--ui3n-input-date-width | max-content |
--ui3n-input-date-z-index | 1000 |
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