Calendar

A date field component that allows users to enter and edit date.

Su Mo Tu We Th Fr Sa

Installation

npx nx g @spartan-ng/cli:ui calendar

Usage

import {
  HlmCalendar
} from '@spartan-ng/helm/calendar';
<hlm-calendar [(date)]="selectedDate" [min]="minDate" [max]="maxDate" />

Brain API

BrnCalendarCellButton

Selector: button[brnCalendarCellButton]

Inputs

PropTypeDefaultDescription
date* (required) T - The date this cell represents

BrnCalendarCell

Selector: [brnCalendarCell]

BrnCalendarGrid

Selector: [brnCalendarGrid]

BrnCalendarHeader

Selector: [brnCalendarHeader]

Inputs

PropTypeDefaultDescription
id unknown `brn-calendar-header-${uniqueId++}` The unique id for the header

BrnCalendarNextButton

Selector: [brnCalendarNextButton]

BrnCalendarPreviousButton

Selector: [brnCalendarPreviousButton]

BrnCalendarWeek

Selector: [brnCalendarWeek]

BrnCalendarWeekday

Selector: [brnCalendarWeekday]

BrnCalendar

Selector: [brnCalendar]

Inputs

PropTypeDefaultDescription
min T - The minimum date that can be selected.
max T - The maximum date that can be selected.
disabled boolean false Determine if the date picker is disabled.
dateDisabled (date: T) => boolean () => false Whether a specific date is disabled.
weekStartsOn Weekday 0 The day the week starts on
defaultFocusedDate T - The default focused date.
date T - The selected value.

Outputs

PropTypeDefaultDescription
dateChanged T - The selected value.

BrnCalendarMulti

Selector: [brnCalendarMulti]

Inputs

PropTypeDefaultDescription
min T - The minimum date that can be selected.
max T - The maximum date that can be selected.
minSelection number undefined The minimum selectable dates.
maxSelection number undefined The maximum selectable dates.
disabled boolean false Determine if the date picker is disabled.
dateDisabled (date: T) => boolean () => false Whether a specific date is disabled.
weekStartsOn Weekday 0 The day the week starts on
defaultFocusedDate T - The default focused date.
date T[] - The selected value.

Outputs

PropTypeDefaultDescription
dateChanged T[] - The selected value.

Helm API

HlmCalendarMulti

Selector: hlm-calendar-multi

Inputs

PropTypeDefaultDescription
calendarClass ClassValue --
min T - The minimum date that can be selected.
max T - The maximum date that can be selected.
minSelection number undefined The minimum selectable dates.
maxSelection number undefined The maximum selectable dates.
disabled boolean false Determine if the date picker is disabled.
dateDisabled (date: T) => boolean () => false Whether a specific date is disabled.
weekStartsOn Weekday 0 The day the week starts on
defaultFocusedDate T - The default focused date.
date T[] - The selected value.

Outputs

PropTypeDefaultDescription
dateChanged T[] - The selected value.

HlmCalendar

Selector: hlm-calendar

Inputs

PropTypeDefaultDescription
calendarClass ClassValue --
min T - The minimum date that can be selected.
max T - The maximum date that can be selected.
disabled boolean false Determine if the date picker is disabled.
dateDisabled (date: T) => boolean () => false Whether a specific date is disabled.
weekStartsOn Weekday 0 The day the week starts on
defaultFocusedDate T - The default focused date.
date T - The selected value.

Outputs

PropTypeDefaultDescription
dateChanged T - The selected value.

Examples

Multiple Selection

Use hlm-calendar-multi for multiple date selection. Limit the selectable dates using minSelection and maxSelection inputs.

Su Mo Tu We Th Fr Sa
Carousel Button