Date & time

Date picker

@xui/date-picker

An inline month calendar. Click a day to select it; arrow keys move by day/week, PageUp/PageDown by month, Home/End to the week ends, Enter/Space select. [(value)] two-way binding, min/max/dateFilter, an optional Today/Clear action bar. Uses the app's DateAdapter (native Date by default).

Install

pnpm add @xui/date-picker

Add the barrel to a standalone component's imports:

import { XuiDatePickerImports } from '@xui/date-picker';

@Component({
  imports: [XuiDatePickerImports],
  // …
})

Examples

Default

Loading preview…

Constrained

Loading preview…

API

XuiDatePicker

componentxui-date-picker

An inline month calendar. Click a day to select it; arrow keys move by day/week, PageUp/PageDown by month, Home/End to week ends, Enter/Space select. [(value)] two-way binding. T is the date type of the active DateAdapter (a Date by default). It is a full ControlValueAccessor, so ngModel/formControl bind to it directly.

Inputs

NameTypeDefaultclassClassValueExtra classes, merged into the component's own rather than replacing them.''valuetwo-wayT | nullThe selected date. Two-way bindable with [(value)].nullminT | nullEarliest selectable date. Earlier days are rendered disabled.nullmaxT | nullLatest selectable date. Later days are rendered disabled.nulldateFilter((date: T) => boolean) | nullPer-date predicate for holes that min/max cannot express — weekends, blackout days. Return false to disable a date.nullfirstDayOfWeeknumberWhich weekday the grid starts on, 0 for Sunday through 6 for Saturday.0localestring | undefinedBCP 47 tag used for the weekday and month labels. Defaults to the runtime locale.undefinedshowActionsBarbooleanShow a Today/Clear action bar under the grid.falsedisabledbooleanBlock interaction and dim the calendar.false

Source

libs/ui/date-picker/xui

xUI 2.0.0 — Apache 2.0 licensed. Built with Angular and Tailwind CSS.