New to Kendo UI for AngularStart a free 30-day trial

Represents the Kendo UI DatePicker component for Angular. Provides a user-friendly way to select dates with a calendar popup (see example).

Definition

Package:@progress/kendo-angular-dateinputs

Selector:kendo-datepicker

Export Name:Accessible in templates as #kendo-datepickerInstance="kendo-datepicker"

Syntax:

ts
@Component({
  selector: 'my-app',
  template: `
    <kendo-datepicker
      [value]="selectedDate"
    </kendo-datepicker>
  `
})
export class AppComponent {
  selectedDate = new Date();
}

Inputs

Specifies the active view that the Calendar initially renders (see example).

You have to set activeView within the topView-bottomView range.

Specifies whether to enable adaptive rendering. When enabled, the DatePicker automatically switches between a calendar popup on larger screens and an ActionSheet on mobile devices.

Default:

'none'

Sets the subtitle text rendered in the header of the popup(action sheet). Applicable only when AdaptiveMode is set to auto.

Default:

""

Sets the title of the input element of the DatePicker and the title text rendered in the header of the popup(action sheet). Applicable only when AdaptiveMode is set to auto.

Default:

""

Determines if the users should see a blinking caret inside the Date Input when possible.

Default:

false

Determines whether to enable animation when navigating to previous/next Calendar view. Applies to the classic Calendar only.

This feature uses the Web Animations API. In order to run the animation in browsers that do not support it, you need the web-animations-js polyfill.

Default:

false

Determines whether to autocorrect invalid segments automatically.

Default:

true

autoFill

boolean

When enabled, the DatePicker will autofill the rest of the date to the current date when the component loses focus.

Default:

false

A string array representing custom keys, which will move the focus to the next date format segment.

Default:

[]

Determines whether to automatically move to the next segment after the user completes the current one.

Default:

true

Specifies the bottommost Calendar view to which you can navigate (see example).

Specifies the Calendar type.

Default:

'infinite'

Renders a clear button when set to true after the input text or DatePicker value changes. Click this button to reset the component value to null and trigger the valueChange event.

Default:

false

disabled

boolean

Specifies or gets the disabled property of the DatePicker and determines whether the component is active (see example). To learn how to disable the component in reactive forms, refer to the article on Forms Support.

Default:

false

disabledDates

Date[] | Day[] | (date: Date) => boolean

Sets the dates of the DatePicker that will be disabled (see example).

Determines whether the built-in validator for disabled date ranges is enforced when validating a form (see example).

Default:

true

Indicates whether the mouse scroll can be used to increase/decrease the time segments values.

Default:

true

Specifies the fillMode of the component. The default value is set by the Kendo theme.

Specifies the focused date of the Calendar component (see example).

Default:

null

boolean

Controls the visibility of the Calendar footer.

Default:

false

Specifies the date format that is used to display the input value (see example).

Format value options include string to provide a single format that is used regardless whether the input is focused or blurred. FormatSettings can be used to display different formats when the component is focused or blurred by providing a settings object with specified inputFormat and displayFormat values.

Default:

DEFAULT_FORMAT

Defines the descriptions of the format sections in the input field. (more information and examples).

Determines whether the built-in validation for incomplete dates is to be enforced when a form is being validated.

Default:

false

inputAttributes

{ [key: string]: string }

Specifies the HTML attributes of the inner focusable input element. You cannot change attributes that are essential for certain component functionalities.

max

Date

Specifies the biggest valid date (see example).

min

Date

Specifies the smallest valid date (see example).

boolean

Sets or gets the navigation property of the Calendar and determines whether the navigation side-bar is displayed. (see example).

Specifies the hint the DatePicker displays when its value is null. (more information and exaples).

Configures the popup options of the DatePicker.

The available options are animate which controls the popup animation and by default, the open and close animations are enabled. The appendTo option controls the popup container and by default, the popup will be appended to the root component. The popupClass option specifies a list of CSS classes that are used to style the popup.

Determines whether the built-in min or max validators are enforced when validating a form.

Default:

true

readonly

boolean

Specifies the read-only state of the DatePicker (see example).

Default:

false

Sets the read-only state of the DatePicker input field (see example).

If you set the readonly property value to true, the input will be rendered in a read-only state regardless of the readOnlyInput value.

Default:

false

Specifies the border radius of the component. The default value is set by the Kendo theme.

Shows the days that fall outside the current month in the Calendar (see example). The default value is false for infinite Calendar type and true for classic Calendar type.

Sets the size of the component. The default value is set by the Kendo theme.

tabindex

number

Sets the tabindex of the DatePicker. This property is used to set the order in which the DatePicker will receive focus when navigating through the page using the Tab key.

Default:

0

Specifies the topmost Calendar view to which you can navigate (see example).

The maximum year to assume to be from the current century when typing two-digit year value (see example).

The default value is 68, indicating that typing any value less than 69 will be assumed to be 20xx, while 69 and larger will be assumed to be 19xx.

Default:

TWO_DIGIT_YEAR_MAX

value

Date

Specifies the value of the DatePicker component.

The value has to be a valid JavaScript Date instance or null.

Specifies the format of the displayed Calendar week days' names.

Default:

"short"

weekNumber

boolean

Determines whether to display a week number column in the month view of the Calendar (see example).

Default:

false

Fields

isOpen

boolean

Indicates whether the component is currently open. That is when the popup or actionSheet is open.

Events

Fires each time the input element gets blurred (see example).

Fires each time the popup is about to close (see example). This event is preventable. If you cancel the event, the popup will remain open.

Fires each time the user focuses the input element (see example).

Fires each time the popup is about to open (see example). This event is preventable. If you cancel the event, the popup will remain closed.

Fires each time the user selects a new value (see example).

Methods

Blurs the DatePicker component.

Focuses the DatePicker component.

Toggles the visibility of the popup or actionSheet. If you use the toggle method to show or hide the popup or actionSheet, the open and close events do not fire.

Parameters:show?boolean

The state of the popup.