• Getting Started
  • Components
    • Barcodes
    • Buttons
    • Chartsupdated
    • Conversational UIupdated
    • Data Query
    • Date Inputs
    • Date Math
    • Dialogs
    • Drawing
    • Dropdownsupdated
    • Editor
    • Excel Export
    • File Saver
    • Filter
    • Gantt
    • Gauges
    • Gridupdated
    • Icons
    • Indicators
    • Inputsupdated
    • Labels
    • Layout
    • ListBox
    • ListView
    • Map
    • Menus
    • Navigation
    • Notification
    • Pager
    • PDF Export
    • PDFViewer
    • PivotGrid
    • Popup
    • ProgressBars
    • Ripple
    • Schedulerupdated
    • ScrollView
    • Sortable
    • Spreadsheetupdated
    • ToolBar
    • Tooltips
    • TreeList
    • TreeViewupdated
    • Typography
    • Uploads
    • Utilities
  • Styling & Themes
  • Common Features
  • Project Setup
  • Knowledge Base
  • Sample Applications
  • FAQ
  • Troubleshooting
  • Updates
  • Changelogs
New to Kendo UI for Angular? Start a free 30-day trial

DatePickerComponent

Represents the Kendo UI DatePicker component for Angular.

Selector

kendo-datepicker

Export Name

Accessible in templates as #kendoDatePickerInstance="kendo-datepicker"

Inputs

NameTypeDefaultDescription

activeView

CalendarView

Defines the active view that the Calendar initially renders (see example). By default, the active view is month.

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

adaptiveMode

AdaptiveMode

Enables or disables the adaptive mode. By default the adaptive rendering is disabled.

allowCaretMode

boolean

false

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

animateCalendarNavigation

boolean

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.

autoFill

boolean

false

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

autoSwitchKeys

string[]

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

autoSwitchParts

boolean

true

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

bottomView

CalendarView

Defines the bottommost Calendar view to which the user can navigate (see example).

calendarType

CalendarType

Specifies the Calendar type.

The possible values are:

  • infinite (default)
  • classic

disabled

boolean

Sets 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.

disabledDates

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

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

disabledDatesValidation

boolean

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

enableMouseWheel

boolean

true

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

fillMode

DateInputFillMode

Sets the fillMode of the component.

The possible values are:

  • solid (Default)
  • flat
  • outline
  • none

focusedDate

Date

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

format

string | FormatSettings

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

Format value options:

  • string - Provide a string if a single format is going to be used regardless whether the input is focused or blurred.
  • FormatSettings - To display different formats when the component is focused or blurred, provide a settings object with specified inputFormat and displayFormat values.

formatPlaceholder

DateInputFormatPlaceholder

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

@Component({
selector: 'my-app',
template: `
<div class="row example-wrapper" [style.min-height.px]="450">
 <div class="col-xs-12 col-md-6 example-col">
   <p>Full-length format description:</p>
   <kendo-datepicker formatPlaceholder="wide"></kendo-datepicker>
 </div>

 <div class="col-xs-12 col-md-6 example-col">
   <p>Narrow-length format description:</p>
   <kendo-datepicker formatPlaceholder="narrow"></kendo-datepicker>
 </div>

 <div class="col-xs-12 col-md-6 example-col">
   <p>Short-length format description:</p>
   <kendo-datepicker formatPlaceholder="short"></kendo-datepicker>
 </div>

 <div class="col-xs-12 col-md-6 example-col">
   <p>Display defined format:</p>
   <kendo-datepicker format="MM/dd/yyyy" formatPlaceholder="formatPattern"></kendo-datepicker>
 </div>

 <div class="col-xs-12 col-md-6 example-col">
   <p>Custom defined format descriptions</p>
   <kendo-datepicker format="MM/dd/yyyy"
     [formatPlaceholder]="{ year: 'y', month: 'M', day: 'd' }"
   ></kendo-datepicker>
 </div>
</div>
`
})
export class AppComponent { }

incompleteDateValidation

boolean

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

max

Date

Specifies the biggest valid date (see example). By default, the max value is 2099-12-31.

min

Date

Specifies the smallest valid date (see example). By default, the min value is 1900-1-1.

navigation

boolean

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

placeholder

string

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

@Component({
selector: 'my-app',
template: `
 <kendo-datepicker placeholder="Enter birth date..."></kendo-datepicker>
`
})
export class AppComponent { }

popupSettings

PopupSettings

Configures the popup options of the DatePicker.

The available options are:

  • animate: Boolean—Controls the popup animation. By default, the open and close animations are enabled.
  • appendTo: 'root' | 'component' | ViewContainerRef—Controls the popup container. By default, the popup will be appended to the root component.
  • popupClass: String—Specifies a list of CSS classes that are used to style the popup.

rangeValidation

boolean

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

readonly

boolean

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

readOnlyInput

boolean

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

Note that if you set the readonly property value to true,

the input will be rendered in a read-only state regardless of the readOnlyInput value.

rounded

DateInputRounded

Sets the border radius of the component.

The possible values are:

  • small
  • medium (Default)
  • large
  • full
  • none

size

DateInputSize

Sets the size of the component.

The possible values are:

  • small
  • medium (Default)
  • large
  • none

subtitle

string

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

tabindex

number

Sets or gets the tabindex property of the DatePicker.

title

string

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.

topView

CalendarView

Defines the topmost Calendar view to which the user can navigate (see example).

twoDigitYearMax

number

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.

value

Date

Specifies the value of the DatePicker component.

The value has to be a valid

JavaScript Date instance.

weekNumber

boolean

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

Fields

NameTypeDefaultDescription

isOpen

boolean

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

Events

NameTypeDescription

close

EventEmitter<PreventableEvent>

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

blur

EventEmitter<any>

Fires each time the input element gets blurred (more information and example).

To wire the event programmatically, use the onBlur property.

@Component({
selector: 'my-app',
template: `
 <kendo-datepicker (blur)="handleBlur()"></kendo-datepicker>
`
})
export class AppComponent {
  public handleBlur(): void {
     console.log("Component is blurred");
  }
}

focus

EventEmitter<any>

Fires each time the user focuses the input element (more information and example).

To wire the event programmatically, use the onFocus property.

@Component({
selector: 'my-app',
template: `
 <kendo-datepicker (focus)="handleFocus()"></kendo-datepicker>
`
})
export class AppComponent {
  public handleFocus(): void {
     console.log("Component is focused");
  }
}

open

EventEmitter<PreventableEvent>

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

valueChange

EventEmitter<Date>

Fires each time the user selects a new value (more information and example).

Methods

blur

Blurs the DatePicker component.

focus

Focuses the DatePicker component.

@Component({
selector: 'my-app',
template: `
 <button (click)="datepicker.focus()">Focus date picker</button>
 <kendo-datepicker #datepicker></kendo-datepicker>
`
})
export class AppComponent { }

toggle

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.