Create

Form

Calendar

Copy page View as Markdown Open in ChatGPT Open in Claude

A calendar for selecting a date, several dates or a range.

Usage#

app.component.ts
import { WdsCalendarComponent } from '@wds/angular/calendar';

Examples#

Default#

Selecting a day fires wds-change with detail.value, an ISO date (2026-09-24). A click on the caption switches to months and years.

Range#

mode="range": the first click sets start, the second one end; after the first click the range follows the pointer. months="2" shows two months side by side.

From — to —

Multiple#

mode="multiple" toggles each clicked day; the dates are in values.

Presets#

Buttons set value, and month shows the month of that date.

TodayTomorrowIn 3 daysIn a weekIn 2 weeks

Unavailable dates#

min and max limit the dates (the arrows stop at them), disabled-days blocks days of the week (here weekends) and disabledDates single dates, which are crossed out. For rules from an API use isDateDisabled.

Day info#

dayInfo returns extra content for each day: text under the number (here a nightly price), dot and label, which is added to the name of the day for screen readers (by default the text). Give the cells room with --wds-calendar-cell-size.

Select check-in and check-out.

Month and year#

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

Week numbers and locale#

show-week adds week numbers. The names and the first day of the week follow the nearest lang attribute, or locale: in English the week starts on Sunday, in German on Monday.

Cell size#

--wds-calendar-cell-size and --wds-calendar-cell-radius change the size and shape of the cells.

Disabled#

Forms#

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

Signal forms#

WdsDatePickerField connects wds-calendar to [formField] (a string); for mode="multiple" use WdsDatePickerMultipleField (string[]) and for mode="range" WdsDatePickerRangeField ({ start, end }). wds-field-set names the calendar with its legend.

Delivery dateSubmit

Submitted: —

Template-driven#

WdsDatePickerValueAccessor makes ngModel work on wds-calendar; the value type follows mode.

Delivery dateSubmit

Submitted: —

Reactive forms#

The same WdsDatePickerValueAccessor works with formControl and formControlName.

Delivery dateSubmit

Submitted: —

API References#

wds-calendar#

Calendar: selects a date, several dates or a range. A click on the caption goes from days to months and to years (a decade); a selection on a higher level goes back down. Dates are ISO text (2026-09-24). Keyboard (the WAI-ARIA Date Picker pattern): arrows – day/week (in months and years: a grid cell), Home/End – start/end of the week, PageUp/PageDown – previous/next month (with Shift – year), Enter/Space – select, Escape – back from months/years to the previous level.

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.
valuesstring[]multiple mode: the selected dates. In HTML a space-separated list.
startstring''range mode: the start of the range.
endstring''range mode: the end of the range.
minstring''The earliest available date (ISO).
maxstring''The latest available date (ISO).
disabled-dates.disabledDatesstring[]Unavailable dates (e.g. booked ones), crossed out. In HTML a space-separated list.
disabled-days.disabledDaysnumber[][]Unavailable days of the week: 0 = Sunday … 6 = Saturday, e.g. disabled-days="0 6".
monthsnumber1Number of months side by side.
monthstring''The first visible month (2026-09). Defaults to the month of the selected date, or the current one.
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 of month and day names (e.g. en-US). Defaults to the nearest lang attribute.
disabledbooleanfalseDisables the whole calendar.

Properties

PropertyDescription
isDateDisabled((date: string) => boolean) | nullCustom rule for unavailable dates (e.g. dates from an API). Gets an ISO date at the view level.
dayInfo((date: string) => WdsCalendarDayInfo | string | null | undefined) | nullExtra content of each day: text under the number (e.g. a price), a dot, a description for screen readers. Gets an ISO date; a string is the same as { text }. Give the cells room with --wds-calendar-cell-size.

Events

EventDescription
wds-month-changeCustomEvent<WdsCalendarMonthChangeDetail>The user changes the visible month.
wds-changeCustomEvent<WdsCalendarChangeDetail>The user selects a date.

Methods

MethodDescription
focus(options?: FocusOptions)Moves focus to the active cell of the grid.
goTo(date: string)Shows the month of the given date (ISO) and makes that date the active cell.
resetView()Wraca do najniższego poziomu (dni albo view).

CSS parts (::part)

PartDescription
baseThe box with the padding around the calendar.
headerThe header with the month title.
captionThe title (a button that changes the level).
nav-buttonThe previous/next buttons.
gridThe table of days, months or years.
dayA single day (also a month or a year in the higher views).
day-infoText under the day number (dayInfo).
day-dotDot under the day number (dayInfo).

CSS custom properties

PropertyDescription
--wds-calendar-cell-sizeSize of a day cell (default 2rem, at least 24px).
--wds-calendar-cell-radiusRadius of a cell.
--wds-calendar-focusColor of the focus ring (default the text color, contrast at least 3:1).

Accessibility#

Screen reader#

Each month is a table with role="grid" named by the month and year. Days are cells with the full date as their name, aria-selected (also for days inside a range), aria-disabled for unavailable days and aria-current="date" for today.

Only the active day is in the tab sequence (roving tabindex). When the visible month changes, a live region announces the new month.

The caption is a button that switches to months and years; the previous and next buttons are named by what they move (month, year or decade). These names are built in and currently in Polish.

The calendar is not a labelable form field: name it with a heading or a wds-field-set legend, as in the forms examples.

Keyboard support#

KeyFunction
ArrowLeftArrowRightMoves to the previous or next day (month or year in the higher views).
ArrowUpArrowDownMoves to the same day of the previous or next week (a row up or down in the higher views).
HomeEndMoves to the first or last day of the week (row).
PageUpPageDownMoves to the previous or next month; in months a year, in years a decade.
Shift + PageUpShift + PageDownMoves to the previous or next year.
EnterSpaceSelects the day; in months and years goes one level down.
EscapeIn months or years: goes back to the previous level.
Footer