All Components

DatePickerComponent

Represents the Kendo UI DatePicker component for Angular.

Selector

kendo-datepicker

Export Name

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

Inputs

activeView CalendarView

Defines the active view that the Calendar initially renders.
By default, the active view is month.

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

bottomView CalendarView

Defines the bottommost Calendar view, to which the user can navigate.

disabled boolean

Sets or gets the disabled property of the DatePicker and determines whether the component is active.

focusedDate Date

Specifies the focused date of the Calendar component.

format string

Specifies the date format used to display the input value.

formatPlaceholder DateInputFormatPlaceholder

Defines the descriptions of the format sections in the input field.

  • 'wide'—Displays the full description of the format section. For example, turns MM into month. Retrieved from CLDR.
  • 'narrow'—Displays the narrow description of the format section. For example, turns MM into mo.. Retrieved from CLDR.
  • 'short'—Displays the short description of the format section. For example, turns MM into mo.. Retrieved from CLDR.
  • 'formatPattern'—Directly displays the format section. For example, turns MM into MM.
  • [CustomFormatPlaceholder](/kendo-angular-ui/components/dateinputs/api/DateInputCustomFormatPlaceholder/)— An object that defines the description of the format sections. For example, { day: 'd.', month: 'M.', year: 'y', hour: 'h.' }.
@Component({
selector: 'my-app',
template: `
<div class="row example-wrapper" style="min-height: 450px;">
 <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>
`
})
class AppComponent { }

max Date

Specifies the biggest valid date.

min Date

Specifies the smallest valid date.

navigation boolean

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

placeholder string

Specifies the hint the DatePicker displays when its value is null.

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

rangeValidation boolean

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

tabIndex number

Sets or gets the tabIndex property of the DatePicker.

title string

Sets the title of the input element of the DatePicker.

topView CalendarView

Defines the topmost Calendar view, to which the user can navigate.

weekNumber boolean

Determines whether to display a week number column in the month view of the Calendar.

popupSettings PopupSettings

Configures the popup of the DatePicker.

The available options are:

  • animate: Boolean—Controls the popup animation. By default, the open and close animations are enabled.
  • popupClass: String—Specifies a list of CSS classes that are used to style the popup.

value Date

Specifies the value of the DatePicker component.

The value should be a valid JavaScript Date instance.

Fields

isOpen boolean

Returns the current open state of the popup.

Events

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.

blur EventEmitter

Fires each time the input element gets blurred.

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

To wire the event programmatically, use the onBlur property.

focus EventEmitter

Fires each time the user focuses the input element.

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

To wire the event programmatically, use the onFocus property.

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.

valueChange EventEmitter

Fires each time the user selects a new value.

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>
`
})
class AppComponent { }

toggle

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

Parameters

show? boolean

The state of the popup.

In this article