-
Notifications
You must be signed in to change notification settings - Fork 13
defaultMonth attribute
Keke edited this page Jul 16, 2020
·
6 revisions
Selects specific month and year. Calendar opens to this month/year if a date is not selected. When calendar opens and the date is not selected the selection of the month is given month and the selection of the year is given year. In case the date is already selected its selection overrides the value of the defaultMonth. Value of the defaultMonth attribute can be changed dynamically.
<input angular-mydatepicker [(ngModel)]="model" [options]="myDatePickerOptions"
#dp="angular-mydatepicker" [defaultMonth]="defaultMonth">import {IAngularMyDpOptions, IMyDefaultMonth} from 'angular-mydatepicker';
export class MyApp {
myDatePickerOptions: IAngularMyDpOptions = {
// options here...
}
// set default month August of 2019
defaultMonth: IMyDefaultMonth = {
defMonth: '08/2019',
overrideSelection: false
};
constructor() {}
changeDefaultMonthDynamically(): void {
this.defaultMonth = {
defMonth: '09/2020'
};
}
}