For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /dolan/calendar.md.

Calendar

Show a month of days and let the user pick one, in the app's language.

For a form field that opens a calendar in a sheet, use Date Picker.

Installation

npx @blotch/dolan add calendar
import { UiCalendar } from '../components/ui/calendar';
Tip

This also adds Button and Icon, which draw its arrows.

Usage

src/app/app.ts
import { Component, signal } from '@angular/core';
import { UiCalendar } from '../components/ui/calendar';

@Component({
  selector: 'app-root',
  imports: [UiCalendar],
  template: `<ui-calendar [(value)]="day" />`,
})
export class App {
  protected readonly day = signal<Date | null>(null);
}
  • Tapping a day sets value to that day at local midnight, and emits changed.
  • It opens at the month of value, or today's month while value is null.
  • The arrows page through the months.
  • Today has a ring. The chosen day is filled.

Jump to another month or year

Tap the title to see the year's months. Tap it again to see a list of years.

  • Tap a year to see its months, then a month to see its days.
  • Among the months, the arrows page through the years.
  • So a birthday decades back takes five taps: title, title, year, month, day.

Limit the days

<ui-calendar [(value)]="delivery" [min]="tomorrow" [max]="inTwoWeeks" />
  • Days before min or after max are faded, and tapping them does nothing.
  • The arrows stop at the first and last months in range, and the calendar opens inside it.
  • Only the day counts: the time of day in min and max is ignored.

Start the week on another day

<ui-calendar [(value)]="day" [weekStartsOn]="1" />

0 is Sunday and 6 is Saturday. Without weekStartsOn, the week starts where the locale says: Sunday in en-US, Monday in most of Europe.

Languages

The calendar writes every word from Angular's LOCALE_ID: the title, the weekdays and what screen readers say for each day. Set LOCALE_ID with provideLocale(), and register each language's data with registerLocaleData(). It doesn't need the intl build option.

The title follows the locale's own order: November 2026 in English, 2026年11月 in Japanese.

The arrows' screen reader labels are inputs. Mark them for translation like any other attribute:

<ui-calendar
  previousMonthLabel="Previous month"
  i18n-previousMonthLabel
  nextMonthLabel="Next month"
  i18n-nextMonthLabel
  previousYearLabel="Previous year"
  i18n-previousYearLabel
  nextYearLabel="Next year"
  i18n-nextYearLabel
  [(value)]="day"
/>

API

InputTypeDefaultDescription
valueDate | nullnullThe chosen day, at local midnight. Supports [(value)].
minDate | nullnullThe first day that can be picked.
maxDate | nullnullThe last day that can be picked.
weekStartsOn0 | 1 | 2 | 3 | 4 | 5 | 6The locale'sThe weekday in the first column. 0 is Sunday.
previousMonthLabelstring'Previous month'What screen readers say for the arrow back, among the days.
nextMonthLabelstring'Next month'What screen readers say for the arrow on, among the days.
previousYearLabelstring'Previous year'What screen readers say for the arrow back, among the months.
nextYearLabelstring'Next year'What screen readers say for the arrow on, among the months.
classstring''Extra Tailwind classes for the calendar's column.
OutputTypeDescription
changedDateEmits the day the user tapped.
valueChangeDate | nullEmits the new value, for [(value)].

Weekday, the type of weekStartsOn, is exported too.

Accessibility

  • Each day is a button named by its whole date, such as "Wednesday, November 11, 2026". The chosen day is selected.
  • Days outside min and max, and arrows that lead nowhere, are dimmed to VoiceOver as well.
  • The weekday initials are hidden: each day says its weekday.
  • The title is a button named by what it shows. It stays the same element as the view changes, so focus stays on it.
  • Every control is a touch target at least 48px each way, which meets Android's 48dp and iOS's 44pt. A day is a seventh of the calendar's width, so give the calendar at least 336px.

So a spec finds the days by role:

fireEvent.tap(
  screen.getByRole('button', { name: 'Friday, November 20, 2026' }),
);
expect(
  screen.getByRole('button', {
    name: 'Friday, November 20, 2026',
    selected: true,
  }),
).toBeTruthy();