# datepicker

```ts
import { DatePickerModule } from '@anguless/angulux/datepicker';
```

## DatePicker

`agl-datePicker, agl-datepicker, agl-date-picker` — component

Inherits every input, output and slot of `BaseInput` — see [baseinput.md](baseinput.md).

DatePicker is a form component to work with dates.

| Input | Type | Default | Description |
| --- | --- | --- | --- |
| `iconDisplay` | `'input' \| 'button'` | _not documented_ |  |
| `styleClass` | `string \| undefined` | _not documented_ | Style class of the component. **Deprecated:** since v20.0.0, use `class` instead. |
| `inputStyle` | `{ [klass: string]: any } \| null \| undefined` | _not documented_ | Inline style of the input field. |
| `inputId` | `string \| undefined` | _not documented_ | Identifier of the focus input to match a label defined for the component. |
| `inputStyleClass` | `string \| undefined` | _not documented_ | Style class of the input field. |
| `placeholder` | `string \| undefined` | _not documented_ | Placeholder text for the input. |
| `ariaLabelledBy` | `string \| undefined` | _not documented_ | Establishes relationships between the component and label(s) where its value should be one or more element IDs. |
| `ariaLabel` | `string \| undefined` | _not documented_ | Defines a string that labels the input for accessibility. |
| `iconAriaLabel` | `string \| undefined` | _not documented_ | Defines a string that labels the icon button for accessibility. |
| `dateFormat` | `string \| undefined` | _not documented_ | Format of the date which can also be defined at locale settings. |
| `multipleSeparator` | `string` | _not documented_ | Separator for multiple selection mode. |
| `rangeSeparator` | `string` | _not documented_ | Separator for joining start and end dates on range selection mode. |
| `inline` | `boolean` | _not documented_ | When enabled, displays the datepicker as inline. Default is false for popup mode. |
| `showOtherMonths` | `boolean` | _not documented_ | Whether to display dates in other months (non-selectable) at the start or end of the current month. To make these days selectable use the selectOtherMonths option. |
| `selectOtherMonths` | `boolean \| undefined` | _not documented_ | Whether days in other months shown before or after the current month are selectable. This only applies if the showOtherMonths option is set to true. |
| `showIcon` | `boolean \| undefined` | _not documented_ | When enabled, displays a button with icon next to input. |
| `icon` | `string \| undefined` | _not documented_ | Icon of the datepicker button. |
| `readonlyInput` | `boolean \| undefined` | _not documented_ | When specified, prevents entering the date manually with keyboard. |
| `shortYearCutoff` | `any` | _not documented_ | The cutoff year for determining the century for a date. |
| `hourFormat` | `string` | _not documented_ | Specifies 12 or 24 hour format. |
| `timeOnly` | `boolean \| undefined` | _not documented_ | Whether to display timepicker only. |
| `stepHour` | `number` | _not documented_ | Hours to change per step. |
| `stepMinute` | `number` | _not documented_ | Minutes to change per step. |
| `stepSecond` | `number` | _not documented_ | Seconds to change per step. |
| `showSeconds` | `boolean` | _not documented_ | Whether to show the seconds in time picker. |
| `showOnFocus` | `boolean` | _not documented_ | When disabled, datepicker will not be visible with input focus. |
| `showWeek` | `boolean` | _not documented_ | When enabled, datepicker will show week numbers. |
| `startWeekFromFirstDayOfYear` | `boolean` | _not documented_ | When enabled, datepicker will start week numbers from first day of the year. |
| `showClear` | `boolean` | _not documented_ | When enabled, a clear icon is displayed to clear the value. |
| `dataType` | `string` | _not documented_ | Type of the value to write back to ngModel, default is date and alternative is string. |
| `selectionMode` | `'single' \| 'multiple' \| 'range' \| undefined` | _not documented_ | Defines the quantity of the selection, valid values are "single", "multiple" and "range". |
| `maxDateCount` | `number \| undefined` | _not documented_ | Maximum number of selectable dates in multiple mode. |
| `showButtonBar` | `boolean \| undefined` | _not documented_ | Whether to display today and clear buttons at the footer |
| `todayButtonStyleClass` | `string \| undefined` | _not documented_ | Style class of the today button. |
| `clearButtonStyleClass` | `string \| undefined` | _not documented_ | Style class of the clear button. |
| `autofocus` | `boolean \| undefined` | _not documented_ | When present, it specifies that the component should automatically get focus on load. |
| `autoZIndex` | `boolean` | _not documented_ | Whether to automatically manage layering. |
| `baseZIndex` | `number` | _not documented_ | Base zIndex value to use in layering. |
| `panelStyleClass` | `string \| undefined` | _not documented_ | Style class of the datetimepicker container element. |
| `panelStyle` | `any` | _not documented_ | Inline style of the datetimepicker container element. |
| `keepInvalid` | `boolean` | _not documented_ | Keep invalid value when input blur. |
| `hideOnDateTimeSelect` | `boolean` | _not documented_ | Whether to hide the overlay on date selection. |
| `touchUI` | `boolean \| undefined` | _not documented_ | When enabled, datepicker overlay is displayed as optimized for touch devices. |
| `timeSeparator` | `string` | _not documented_ | Separator of time selector. |
| `focusTrap` | `boolean` | _not documented_ | When enabled, can only focus on elements inside the datepicker. |
| `showTransitionOptions` | `string` | _not documented_ | Transition options of the show animation. **Deprecated:** since v21.0.0, use `motionOptions` instead. |
| `hideTransitionOptions` | `string` | _not documented_ | Transition options of the hide animation. **Deprecated:** since v21.0.0, use `motionOptions` instead. |
| `tabindex` | `number \| undefined` | _not documented_ | Index of the element in tabbing order. |
| `minDate` | `Date \| undefined \| null` | _not documented_ | The minimum selectable date. |
| `maxDate` | `Date \| undefined \| null` | _not documented_ | The maximum selectable date. |
| `disabledDates` | `Date[]` | _not documented_ | Array with dates that should be disabled (not selectable). |
| `disabledDays` | `number[]` | _not documented_ | Array with weekday numbers that should be disabled (not selectable). |
| `showTime` | `boolean` | _not documented_ | Whether to display timepicker. |
| `responsiveOptions` | `DatePickerResponsiveOptions[]` | _not documented_ | An array of options for responsive design. |
| `numberOfMonths` | `number` | _not documented_ | Number of months to display. |
| `firstDayOfWeek` | `number` | _not documented_ | Defines the first of the week for various date calculations. |
| `view` | `DatePickerTypeView` | _not documented_ | Type of view to display, valid values are "date" for datepicker and "month" for month picker. |
| `defaultDate` | `Date \| null` | _not documented_ | Set the date to highlight on first opening if the field is blank. |
| `appendTo` | `HTMLElement \| ElementRef \| TemplateRef<any> \| 'self' \| 'body' \| null \| undefined \| any` | `'self'` | Target element to attach the overlay, valid values are "body" or a local ng-template variable of another element (note: use binding with brackets for template variables, e.g. [appendTo]="mydiv" for a div element having #mydiv as variable name). |
| `motionOptions` | `MotionOptions \| undefined` | _not documented_ | The motion options. |

| Output | Type | Description |
| --- | --- | --- |
| `onFocus` | `EventEmitter<Event>` | Callback to invoke on focus of input field. |
| `onBlur` | `EventEmitter<Event>` | Callback to invoke on blur of input field. |
| `onClose` | `EventEmitter<HTMLElement>` | Callback to invoke when date panel closed. |
| `onSelect` | `EventEmitter<Date>` | Callback to invoke on date select. |
| `onClear` | `EventEmitter<any>` | Callback to invoke when input field cleared. |
| `onInput` | `EventEmitter<any>` | Callback to invoke when input field is being typed. |
| `onTodayClick` | `EventEmitter<Date>` | Callback to invoke when today button is clicked. |
| `onClearClick` | `EventEmitter<any>` | Callback to invoke when clear button is clicked. |
| `onMonthChange` | `EventEmitter<DatePickerMonthChangeEvent>` | Callback to invoke when a month is changed using the navigators. |
| `onYearChange` | `EventEmitter<DatePickerYearChangeEvent>` | Callback to invoke when a year is changed using the navigators. |
| `onClickOutside` | `EventEmitter<any>` | Callback to invoke when clicked outside of the date panel. |
| `onShow` | `EventEmitter<HTMLElement>` | Callback to invoke when datepicker panel is shown. |

| Slot | Read as | Description |
| --- | --- | --- |
| `<ng-template #date>` | `dateTemplate` | Custom template for date cells. |
| `<ng-template #header>` | `headerTemplate` | Custom template for header section. |
| `<ng-template #footer>` | `footerTemplate` | Custom template for footer section. |
| `<ng-template #disabledDate>` | `disabledDateTemplate` | Custom template for disabled date cells. |
| `<ng-template #decade>` | `decadeTemplate` | Custom template for decade view. |
| `<ng-template #previousicon>` | `previousIconTemplate` | Custom template for previous month icon. |
| `<ng-template #nexticon>` | `nextIconTemplate` | Custom template for next month icon. |
| `<ng-template #triggericon>` | `triggerIconTemplate` | Custom template for trigger icon. |
| `<ng-template #clearicon>` | `clearIconTemplate` | Custom template for clear icon. |
| `<ng-template #decrementicon>` | `decrementIconTemplate` | Custom template for decrement icon. |
| `<ng-template #incrementicon>` | `incrementIconTemplate` | Custom template for increment icon. |
| `<ng-template #inputicon>` | `inputIconTemplate` | Custom template for input icon. |
| `<ng-template #buttonbar>` | `buttonBarTemplate` | Custom template for button bar. |
