Skip to content

Calendar for Angular

AngularForm Inputs / Date and Time

Month grid for browsing and choosing a PlainDate, or (since 0.3.0) an inclusive date range, following the WAI-ARIA APG date picker grid: localized month heading, previous/next month buttons, a role=grid table with roving tabindex, min/max bounds, consumer-disabled days, optional outside days and ISO week numbers, and (since 0.3.0) one to three consecutive months side by side. ‘Today’ is the current date in the configured timezone.

  • Single day or rangeSelect one day, or a range with minimum and maximum lengths.
  • Business calendarWeekends and holidays are marked and can be made unselectable.
  • Several monthsShows up to three months side by side.
  • Week numbersOptional ISO week numbers and a configurable first day of the week.
  • Full keyboard supportArrow keys, Page Up and Page Down, Home and End move through the grid.

Behavior, design tokens, and limitations are described on the Calendar page; this page covers the Angular API.

import { Component } from '@angular/core';
import { FormControl, ReactiveFormsModule } from '@angular/forms';
import type { PlainDate } from '@absoluteui/core';
import { AuiCalendar } from '@absoluteui/angular/calendar';
@Component({
selector: 'app-booking',
imports: [ReactiveFormsModule, AuiCalendar],
template: `<aui-calendar label="Appointment date" [firstDayOfWeek]="1" [formControl]="date"></aui-calendar>`,
})
export class BookingComponent {
readonly date = new FormControl<PlainDate | null>(null);
}
Terminal window
npm install @absoluteui/angular @absoluteui/components @absoluteui/core @absoluteui/theme

Setup with provideAbsoluteUI() is covered in Getting started. Styles are included with the component.

import { AuiCalendar } from '@absoluteui/angular/calendar';

Defaults for every instance: provideAbsoluteUIConfig({ components: { calendar: { ... } } }) (see Configuration).

Class AuiCalendar; template reference #ref="auiCalendar".

Server rendering: Renders on the server; the browser re-creates it after hydration.

Angular forms: implements ControlValueAccessor; the form value is PlainDate \| null. Bind [formControl], formControlName, or [(ngModel)]; validation messages of the component report through the aui error key. See Forms.

Input Type Default Description
selectionMode CalendarSelectionMode 'single' Since 0.3.0. ‘range’: the first pick sets an anchor, the second completes the range (in either order); value is not used.
range Range<PlainDate> | null null Since 0.3.0. Selected inclusive range in range mode (start <= end).
minDays number Since 0.3.0. Range mode: minimum range length in days, counting the first and last day (integer 1-100000); shorter ends are disabled while the anchor is pending.
maxDays number Since 0.3.0. Range mode: maximum range length in days, counting the first and last day (integer 1-100000); longer ends are disabled while the anchor is pending.
visibleMonths number '1' Since 0.3.0. Consecutive months shown side by side (integer 1-3). Outside days are never shown with more than one month.
min PlainDate | null Inclusive lower bound; earlier days are disabled and focus never moves before it.
max PlainDate | null Inclusive upper bound.
isDateDisabled (date: PlainDate) => boolean Disable individual days (focusable, not selectable).
businessCalendar BusinessCalendarEngine | null Business calendar (since 0.9.0): non-working days and holidays are marked and named in the calendar.
disableNonWorking boolean false With businessCalendar: non-working days cannot be picked or typed (since 0.9.0).
focusedDate PlainDate Initially focused day and visible month. Default: value, else the range start, else today (clamped to min/max).
firstDayOfWeek Weekday ISO weekday of the first column (1 = Monday, 7 = Sunday). Default: the locale’s first day of week.
label string Grid accessible name. Default: the visible month-year heading (aria-labelledby). With several months each grid is named ‘{label}, {month}’.
today PlainDate Advanced: fixed ‘today’ instead of the current date in timezone (tests, server rendering).
icons Partial<CalendarIcons> Icon slot overrides; mirrored in RTL.
showOutsideDays boolean true Show days of the adjacent months in the first and last week (one visible month only).
showWeekNumbers boolean false Show ISO 8601 week numbers as row headers.
locale string 'en-US' Heading, weekday names, day numbers, cell names, and first day of week.
timezone string 'UTC' Zone used only to determine today.
direction "ltr" | "rtl" 'ltr' Grid direction and ArrowLeft/ArrowRight mirroring.
Model Type Change output Description
[(value)] PlainDate | null (valueChange) The value: [(value)] without forms; with Angular forms, bind the form control instead.
Output Payload Description
(changed) CalendarChangeDetail Single mode: the user selected a day (click, Enter, or Space), including re-selecting the current day. Range mode: the user picked the last day; range is the completed range (the first pick emits nothing). Re-emits aui-change.
(navigate) CalendarNavigateDetail The user changed the visible months (keyboard, month buttons, or an outside day); month is the first visible month. Re-emits aui-navigate.

Call them through a viewChild query or a template reference.

Method Description
setRange(range: Range<PlainDate> | null): void Since 0.3.0. Range mode: programmatic range (no events); a pending anchor is discarded and the first day becomes the focused day.
goTo(date: PlainDate): void Show the month of date (scrolling the visible months as needed) and make it the focused day (no events).
focus(): void Move DOM focus to the focused day.

Pattern: WAI-ARIA APG Date Picker Dialog grid: table role=grid whose day cells (td) are the focusable gridcells with a roving tabindex. Since 0.3.0: one grid per visible month with a single roving tab stop across all grids, and range selection (aria-multiselectable grids).

The Angular component renders the framework-neutral component, so its keyboard support, roles, WCAG 2.2 criteria, budgets, and import cost apply unchanged: see Calendar: Accessibility and performance.