Overview

Allows date selection. Directive can be attached to input element. Returns date as string in format ‘yyyy-MM-dd’ (2016-08-30).

<input date-picker 
    [(ngModel)]="date"
    type="text"
    [minDate]="minDate"
    [maxDate]="maxDate" />
    
export class DatePickerExampleComponent {
    date: string = "2016-08-30"; 
    minDate: Date = new Date(new Date().getTime() - 7 * 86400000);
    maxDate: Date = new Date(new Date().getTime() + 7 * 86400000);
}

option name: (type) - description

  • minDate: (Date) - earliest possible selectable date,
  • maxDate: (Date) - latest possible selectable date.