Skip to content
Okaapiأوكابي
Framework for the code
Theme
Okaapi on GitHub

Chapter 05 Choices

Calendar

A month grid to pick a day or a range, such as a delivery day or a stay. One Tab stop: arrow keys move by day and week, Home and End go to the ends of the week, Page Up and Page Down change the month, with Shift the year. Each day is read in full, Thursday, 19 November 2026. Today is underlined and picked days are filled, so neither depends on colour. Use it when seeing the month helps: open and closed days, a range, or the weekday. For a date people already know, such as a birthday, use the date field.

Use it in Angular
import { CalendarComponent, type DateRange } from '@okaapi-ui/angular';
// Dates are ISO strings (YYYY-MM-DD), the same as <input type="date">.

Pick a day

Days before today and Fridays can't be picked: they are struck through and read as dimmed, but arrow keys still reach them so the week reads in order.

December 2026

MTWTFSS

Delivery: not picked yet

Angular
<ui-calendar
  label="Delivery day"
  [min]="today"
  [isDisabled]="friday"
  [(value)]="day"
/>

friday = (date: string) => new Date(`${date}T00:00:00Z`).getUTCDay() === 5;

Pick a range

The first click is the start and the second the end, in either order. A third click starts again.

December 2026

MTWTFSS

Stay: … to …

Angular
<ui-calendar label="Stay" selection="range" [(range)]="stay" />

stay = signal<DateRange | null>(null); // { start, end }, end is null until the second click

In Arabic

ديسمبر ٢٠٢٦

سحنثرخج
Angular
<ui-calendar
  label="يوم التوصيل"
  locale="ar-EG"
  previousLabel="الشهر السابق"
  nextLabel="الشهر التالي"
/>

When to use something else

If you needUse
A date the reader already knows, such as a birthdayDate picker
A time or a date and timeText field with type time

Inputs

NameTypeDefaultWhat it does
labelstring — Names the calendar for screen readers. Required.
min | maxstring — Earliest and latest days that can be picked, as YYYY-MM-DD.
isDisabled(date: string) => boolean — Other days that can not be picked, such as closed days.
selection'single' | 'range''single'One day, or a start and an end.
[(value)]string | null — The picked day when selection is single.
[(range)]DateRange | null — { start, end } when selection is range; end is null until the second pick.
localestringLOCALE_IDMonth and weekday names, digits and the first day of the week.
previousLabel | nextLabelstring'Previous month' | 'Next month' from labelsThe arrow buttons’ names. Translate them.

Keyboard and screen readers

KeysWhat they do
Tab Reach the grid, on the chosen or focused day.
Left or Right Move by a day. Flipped in Arabic.
Up or Down Move by a week.
Home or End Go to the start or end of the week.
Page Up or Page Down Go to the previous or next month.
Shift + Page Up or Shift + Page Down Go to the previous or next year.
Enter or Space Pick the day.
  • Each day is read in full, such as Thursday, 19 November 2026.
  • Today is underlined and picked days are filled, so neither depends on colour.