All Components

Placeholders

For its input field, the DateInput enables you to render a text hint and to provide descriptions for the format sections.

Text Hints

When the value of the DateInput is null, you can specify a text hint for its input field by setting the placeholder option of the component.

@Component({
    selector: 'my-app',
    template: `
      <div class="example-wrapper" style="min-height: 400px;">
          <div class="col-xs-12 col-sm-6 example-col">
              <p>Select date:</p>
              <kendo-dateinput placeholder="Type in your birth date..."></kendo-dateinput>
          </div>
      </div>
    `
})

class AppComponent { }

Format Sections Description

The formatPlaceholder option enables you to set the way the format sections of the input field are rendered. For example, whether the month input is prompted as month or MM.

The formatPlaceholder provides the following available options which you can set:

  • '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-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>
    `
})

class AppComponent { }
In this article