Create

Form

Date Picker

Copy page View as Markdown Open in ChatGPT Open in Claude

A date field with a calendar popup. The date can be typed or picked.

Usage#

app.component.ts
import { WdsDatePickerComponent } from '@wds/angular/date-picker';

Examples#

Default#

Type a date in the format of the page language (e.g. 09/24/2026, also without separators) or pick it in the calendar; ↓ in the field opens the calendar. The value is an ISO date (2026-09-24), as in <input type="date">.

Date

Format#

format sets the pattern of the field: dd, MM, yyyy (or d, M, yy) and any separators.

dd/MM/yyyy yyyy-MM-dd

Locale#

locale sets the default format, the names in the calendar and the first day of the week. Without it they follow the nearest lang attribute.

German British English

Clear and button bar#

clearable adds a clear button to the field; show-button-bar adds “Today” and “Clear” buttons under the calendar (their texts are currently in Polish).

Clearable Button bar

Range#

mode="range": the value is start and end. The calendar closes after the second date.

Stay

Presets#

presets adds ready-made choices next to the calendar, counted from today: today, yesterday, tomorrow, last-7-days, last-14-days, last-30-days, last-90-days, this-week, last-week (from first-day), this-month, last-month, this-quarter, last-quarter, this-year, last-year, year-to-date. A choice sets the value and closes the calendar; the current one is highlighted, and one outside min/max is disabled. On phones the presets are a row above the calendar.

Reporting period

Presets for one date#

In the single mode only one-day presets (today, yesterday, tomorrow or your own with value) are shown.

Due date

Custom presets#

As a property presets also takes your own entries: { label, start, end } for a range or { label, value } for a day, mixed with the built-in keys (types WdsDatePickerPreset and WdsDatePickerPresetKey).

Campaign—

Multiple#

mode="multiple": the calendar stays open and the dates are in values.

Meeting days

Date and time#

time adds hour and minute columns next to the calendar (as in wds-time-picker); the value is a local date and time (2026-09-24T14:30), as in <input type="datetime-local">. Picking a day keeps the popup open for the time; a time picked first applies to today. Works in the single mode; minute-step, seconds and hour-cycle work as in the time picker.

Departure Departure, 12-hour

Mobile panel#

On screens narrower than 640 px (panel="auto") the calendar opens in a panel at the bottom of the screen: one month, larger days, a “Done” button, and focus straight in the calendar so the on-screen keyboard stays hidden. panel="sheet" (here) always opens the panel, panel="popup" never.

Check-in

Unavailable dates#

min, max, disabled-days and disabledDates work as in wds-calendar. A typed date that is not available makes the field invalid, with a message in validationMessage.

AppointmentWeekdays within the next 30 days. Value: —

Month and year#

view="month" picks a month (2026-09) and view="year" a year (2026).

Card expiry Year of manufacture

Week numbers#

show-week shows week numbers in the calendar.

Date

Invalid#

invalid on wds-field (or on the date picker) shows the error state.

Date Select a date.

Disabled and read-only#

disabled blocks the field; readonly keeps it focusable but without typing and without the calendar.

Disabled Read-only

Field#

In wds-field the label and the description become the accessible name and description of the field.

Date of birth Used to check your age.

Forms#

Integration with Angular forms. Pick the API your app uses.

Signal forms#

WdsDatePickerField connects wds-date-picker to [formField] (a string). For mode="multiple" use WdsDatePickerMultipleField (string[]) and for mode="range" WdsDatePickerRangeField ({ start, end }).

Check-in dateSubmit

Submitted: —

Template-driven#

WdsDatePickerValueAccessor makes ngModel work on wds-date-picker; the value type follows mode (string, string[] or { start, end }).

Check-in dateSubmit

Submitted: —

Reactive forms#

The same WdsDatePickerValueAccessor works with formControl and formControlName.

Check-in dateSubmit

Submitted: —

API References#

wds-date-picker#

A date field with a calendar in a popup. The date can be typed (in the format of the page language, e.g. mm/dd/yyyy, or format) or selected in the calendar. The value is ISO text (2026-09-24), as in <input type="date">. A form control: name submits the date (in multiple mode each date separately, in range the start and the end); required, min and max validate as in a native field, and text that is not a valid date gives badInput. With time (the single mode) hour and minute columns sit next to the calendar and the value is a local date and time (2026-09-24T14:30), as in <input type="datetime-local">. On phones the calendar opens in a panel at the bottom of the screen (panel). Keyboard: ↓ (or Alt+↓) in the field opens the calendar with focus on the date; Escape closes it and returns to the field.

Attributes

AttributeTypeDefaultDescription
modeWdsCalendarMode'single'single – one date, multiple – several dates, range – a range from–to.
viewWdsCalendarView'date'Smallest unit of selection: date (a day), month (2026-09) or year (2026).
valuestring''single mode: the selected date (ISO), with time the date and time (2026-09-24T14:30).
valuesstring[]multiple mode: the selected dates (ISO). In HTML a space-separated list.
startstring''range mode: the start of the range (ISO).
endstring''range mode: the end of the range (ISO).
minstring''The earliest allowed date (ISO).
maxstring''The latest allowed date (ISO).
disabled-dates.disabledDatesstring[]Unavailable dates. In HTML a space-separated list.
disabled-days.disabledDaysnumber[][]Unavailable days of the week: 0 = Sunday … 6 = Saturday.
monthsnumber1Number of months in the calendar.
first-day.firstDaynumber | undefinedFirst day of the week: 0 = Sunday, 1 = Monday. Defaults to the language.
show-week.showWeekbooleanfalseShows week numbers.
hide-outside-days.hideOutsideDaysbooleanfalseHides days of the adjacent months.
localestring''Language (e.g. en-US). Defaults to the nearest lang attribute.
formatstring''Format of the field, e.g. dd.MM.yyyy, MM/dd/yyyy, yyyy-MM-dd. Defaults to the language.
placeholderstring''Placeholder of the empty field. Defaults to the format, e.g. mm/dd/yyyy.
namestring''Field name in a form.
requiredbooleanfalseA date is required (valueMissing when empty).
disabledbooleanfalseDisables the field.
readonlybooleanfalseRead-only: no typing and no calendar.
invalidbooleanfalseError state (e.g. from the app's validation).
clearablebooleanfalseA clear button in the field when a date is selected.
show-button-bar.showButtonBarbooleanfalseA bar with the "Today" and "Clear" buttons under the calendar.
timebooleanfalseAdds hour and minute columns (the single mode with view="date"); the value is 2026-09-24T14:30.
minute-step.minuteStepnumber1With time: minutes between the options of the minute column (e.g. 15).
secondsbooleanfalseWith time: adds a seconds column (2026-09-24T14:30:15).
hour-cycle.hourCycle12 | 24 | undefinedWith time: 12 or 24-hour clock. Defaults to the language.
panelWdsPickerPanel'auto'Where the calendar opens: auto (a popup, on phones a panel at the bottom), popup or sheet.
presets(WdsDatePickerPresetKey | WdsDatePickerPreset)[][]Ready-made choices next to the calendar, e.g. presets="today last-7-days this-month". Built-in keys are counted from today: today, yesterday, tomorrow, last-7-days, last-14-days, last-30-days, last-90-days, this-week, last-week, this-month, last-month, this-quarter, last-quarter, this-year, last-year, year-to-date. As a property it also takes your own { label, value } or { label, start, end }. Ranges show in range mode, single days in single and range mode.
openbooleanfalseWhether the calendar is open.

Properties

PropertyDescription
isDateDisabled((date: string) => boolean) | nullCustom rule for unavailable dates (e.g. dates from an API).
dayInfo((date: string) => WdsCalendarDayInfo | string | null | undefined) | nullExtra content of each day in the calendar (text under the number, a dot), as in wds-calendar.

Events

EventDescription
wds-changeCustomEvent<WdsDatePickerChangeDetail>The user changes the date (calendar, typing, clearing).
wds-open-changeCustomEvent<WdsDatePickerOpenChangeDetail>The user opens or closes the calendar.

Methods

MethodDescription
show()Opens the calendar.
close()Closes the calendar.
focus(options?: FocusOptions)
formResetCallback()
formDisabledCallback(disabled: boolean)
checkValidity()Returns true when the value is valid; otherwise fires invalid on the element.
reportValidity()Like checkValidity(), and shows the browser validation bubble when the value is invalid.
setCustomValidity(message: string)Sets a custom validation error (an empty string clears it), like input.setCustomValidity().

CSS parts (::part)

PartDescription
fieldThe field border.
inputThe native <input>.
clearThe clear button.
triggerThe button with the calendar icon.
popupThe popup with the calendar.
calendarThe wds-calendar in the popup.
footerThe bar with the "Today" and "Clear" buttons.
presetsThe column of presets next to the calendar.
presetA single preset button.
timeThe hour and minute columns (time).
time-optionA single hour, minute, second or AM/PM (time).

CSS custom properties

PropertyDescription
--wds-date-picker-widthWidth of the field.

Accessibility#

Screen reader#

The text field has role="combobox" with aria-haspopup="dialog" and aria-expanded. Give it a name with wds-field-label or aria-label; the fallback name (Data) is in Polish.

The calendar opens in a popup with role="dialog"; inside it works like wds-calendar (grid, full dates as cell names, live region for the month).

The calendar button, the clear button, the popup and the validation messages have built-in names and texts that are currently in Polish.

The presets are a group named “Presets”; each is a toggle button with aria-pressed on the current one.

invalid, required and a typed text that is not a date set aria-invalid / aria-required. In a form the date is submitted under name (each date in multiple, start and end in range).

Keyboard support#

KeyFunction
ArrowDownAlt + ArrowDownIn the field: opens the calendar with focus on the selected date (or today).
EnterIn the field: accepts the typed date and closes the calendar.
EscapeCloses the calendar and returns focus to the field. In the months or years view it first goes back a level.
TabMoving focus out of the date picker accepts the typed text and closes the calendar.
ArrowsPageUpPageDownHomeEndEnterSpaceIn the calendar: as in wds-calendar.
Shift + Tab↑↓With presets: Shift+Tab from the calendar (past its header buttons) reaches the presets, ↑ and ↓ move between them, and Enter or Space chooses one.
TabWith time: from the calendar to the hour and minute columns, which work as in wds-time-picker.
Footer