Loading...
Installation
Install the following dependencies:
Copy and paste the following code into your project.
Loading...
Update the import paths to match your project setup.
Composition
<app-calendar> ├── <app-calendar-day-view> │ └── <app-calendar-select-header> ├── <app-calendar-dual-month-day-view> ├── <app-calendar-month-view> │ └── <app-calendar-select-header> └── <app-calendar-year-view> └── <app-calendar-select-header>
Examples
Default
Loading...
Month Year Selector
Loading...
Presets
Loading...
Range Vertical
Loading...
Range With Presets
Loading...
Range
Loading...
API Reference
<app-calendar>
Inputs
| Input | Type | Default | Description |
|---|---|---|---|
id | string | undefined | generated | Unique identifier used to connect the calendar parts. |
ids | Partial<DatePickerElementIds> | undefined | — | Overrides generated identifiers for individual parts. |
value | DateValue[] | undefined | — | Selected dates when controlled. Supports Angular two-way binding. |
defaultValue | DateValue[] | undefined | — | Initially selected dates when uncontrolled. |
focusedValue | DateValue | undefined | — | Focused date when controlled. Supports Angular two-way binding. |
defaultFocusedValue | DateValue | undefined | — | Initially focused date. |
view | "day" | "month" | "year" | undefined | — | Current calendar view when controlled. Supports Angular two-way binding. |
defaultView | "day" | "month" | "year" | undefined | — | Initial calendar view. |
open | boolean | undefined | — | Whether the calendar is open when controlled. Supports two-way binding. |
defaultOpen | boolean | false | Initial open state when uncontrolled. |
inline | boolean | false | Renders the calendar inline instead of as popup content. |
disabled | boolean | false | Disables interaction with the calendar. |
readOnly | boolean | false | Prevents changes while preserving focus and navigation. |
required | boolean | false | Marks the associated form control as required. |
invalid | boolean | false | Marks the associated form control as invalid. |
outsideDaySelectable | boolean | false | Allows days outside the visible month to be selected. |
closeOnSelect | boolean | true | Closes popup content after a selection is completed. |
openOnClick | boolean | false | Opens popup content when its input is clicked. |
fixedWeeks | boolean | false | Always renders six calendar weeks. |
showWeekNumbers | boolean | false | Includes week numbers in the calendar grid. |
min | DateValue | undefined | — | Earliest selectable date. |
max | DateValue | undefined | — | Latest selectable date. |
minView | "day" | "month" | "year" | undefined | — | Most detailed view available. |
maxView | "day" | "month" | "year" | undefined | — | Broadest view available. |
numOfMonths | number | undefined | — | Number of months represented by the calendar state. |
startOfWeek | number | undefined | — | First weekday, from 0 for Sunday through 6 for Saturday. |
selectionMode | "single" | "multiple" | "range" | undefined | — | Determines how dates are selected. |
maxSelectedDates | number | undefined | — | Limits selections in multiple mode. |
locale | string | undefined | — | Locale used to format and parse dates. |
timeZone | string | undefined | — | Time zone used when converting and formatting values. |
translations | DatePickerIntlTranslations | undefined | — | Accessible labels for the calendar controls. |
name | string | undefined | — | Name used when submitting the value with a form. |
placeholder | string | undefined | — | Placeholder used by the default formatter. |
format | ((date: DateValue, details: DatePickerLocaleDetails) => string) | undefined | — | Formats values for inputs and value text. |
parse | ((value: string, details: DatePickerLocaleDetails) => DateValue | undefined) | undefined | — | Parses typed input into a date value. |
createCalendar | ((identifier: CalendarIdentifier) => Calendar) | undefined | — | Creates the calendar system used by the component. |
isDateUnavailable | ((date: DateValue, locale: string) => boolean) | undefined | — | Marks dates that cannot be selected. |
positioning | DatePickerPositioningOptions | undefined | — | Configures popup placement and collision handling. |
Use [(value)]="value", [(focusedValue)]="focusedValue", [(view)]="view", or
[(open)]="open" for two-way binding. The matching *Change output emits the updated model
value.
Outputs
| Output | Type | Description |
|---|---|---|
valueChange | DateValue[] | undefined | Emits the updated selected dates. |
focusedValueChange | DateValue | undefined | Emits the updated focused date. |
viewChange | "day" | "month" | "year" | undefined | Emits the updated calendar view. |
openChange | boolean | undefined | Emits the updated open state. |
valueDetailsChange | DatePickerValueChangeDetails | Emits detailed selection-change information. |
focusChange | DatePickerFocusChangeDetails | Emits when the focused date changes. |
viewDetailsChange | DatePickerViewChangeDetails | Emits detailed view-change information. |
visibleRangeChange | DatePickerVisibleRangeChangeDetails | Emits when the visible date range changes. |
openDetailsChange | DatePickerOpenChangeDetails | Emits detailed open-state change information. |
Components, Directives, and Context
| Export | Angular API |
|---|---|
CalendarSelectHeader | Month/year selector and previous/next controls used by single-month views. |
CalendarDayView | Renders the single-month day grid. |
CalendarDualMonthDayView | Renders two adjacent month grids with shared navigation. |
CalendarMonthView | Renders the month-selection grid. |
CalendarYearView | Renders the year-selection grid. |
CalendarPresetTrigger | Alias of the [date-picker-preset-trigger] directive for preset selections. |
DatePickerContext | Structural directive [date-picker-context] exposed through CalendarImports. |
CalendarImports | Readonly collection containing all calendar components and context helpers. |
Utilities and Supporting Types
| Export | API |
|---|---|
CalendarDate | Represents a calendar date without a time or time zone. |
getLocalTimeZone | Returns the current local IANA time-zone identifier. |
parseDate | Parses an ISO 8601 date string into a CalendarDate. |
DateValue | Date value accepted by the calendar component. |
Angular
React
Solid
Svelte
Vue