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

DateInputComponent

Represents the Kendo UI DateInput component for Angular.

Selector

kendo-dateinput

Export Name

Accessible in templates as #kendoDateInputInstance="kendo-dateinput"

Inputs

NameTypeDefaultDescription

allowCaretMode

boolean

false

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

autoCorrectParts

boolean

true

Determines whether to autocorrect invalid segments automatically.

autoFill

boolean

false

When enabled, the DateInput 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.

clearButton

boolean

false

If set to true, renders a clear button after the input text or DateInput value has been changed. Clicking this button resets the value of the component to null and triggers the valueChange event.

disabled

boolean

Sets or gets the disabled property of the DateInput 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.

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

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. For more information, refer to the article on placeholders.

ts
@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-dateinput formatPlaceholder="wide"></kendo-dateinput>
 </div>

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

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

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

 <div class="col-xs-12 col-md-6 example-col">
   <p>Custom defined format descriptions</p>
   <kendo-dateinput format="G"
     [formatPlaceholder]="{
       year: 'y', month: 'M', day: 'd',
       hour: 'h', minute: 'm', second: 's'
     }"
   ></kendo-dateinput>
 </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.

inputAttributes

{[key: string]: string}

Sets the HTML attributes of the inner focusable input element. Attributes which are essential for certain component functionalities cannot be changed.

max

Date

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

min

Date

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

placeholder

string

Specifies the hint the DateInput displays when its value is null. For more information, refer to the article on placeholders.

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

rangeValidation

boolean

Determines whether the built-in min or max validators are to be enforced when a form is being validated.

readonly

boolean

false

Sets or gets the read-only state of the DateInput (see example).

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

spinners

boolean

Specifies whether the Up and Down spin buttons will be rendered. For more information, refer to the article on spinner buttons.

steps

DateInputIncrementalSteps

Configures the incremental steps of the DateInput. For more information, refer to the article on incremental steps.

ts
@Component({
selector: 'my-app',
template: `
 <kendo-dateinput [steps]="steps"></kendo-dateinput>
`
})
export class AppComponent {
  public steps = { year: 10, month: 1, day: 5 };
}

tabindex

number

Sets or gets the tabIndex property of the DateInput.

title

string

Sets the title of the input element of the DateInput.

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 DateInput component.

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

Events

NameTypeDescription

blur

EventEmitter<null>

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

focus

EventEmitter<null>

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

valueChange

EventEmitter<Date>

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

Methods

blur

Blurs the DateInput component.

focus

Focuses the DateInput component.

ts
@Component({
selector: 'my-app',
template: `
 <button (click)="dateinput.focus()">Focus date input</button>
 <kendo-dateinput #dateinput></kendo-dateinput>
`
})
export class AppComponent { }
In this article
SelectorExport NameInputsEventsMethods
Not finding the help you need?
Contact Support