- Notifications
You must be signed in to change notification settings - Fork 13
disable since tomorrow
kekeh edited this page May 26, 2019 · 3 revisions
<input angular-mydatepicker [(ngModel)]="model" [options]="myDatePickerOptions" #dp="angular-mydatepicker" />
import {IAngularMyDpOptions} from 'angular-mydatepicker'; export class MyApp { myDatePickerOptions: IAngularMyDpOptions = { // options here... disableSince: {year: 0, month: 0, day: 0} } constructor() {} // Calling this function set disableSince value to tomorrow disableSince() { let d: Date = new Date(); d.setDate(d.getDate() + 1); let copy: IAngularMyDpOptions = this.getCopyOfOptions(); copy.disableSince = {year: d.getFullYear(), month: d.getMonth() + 1, day: d.getDate()}; this.myDatePickerOptions = copy; } getCopyOfOptions(): IAngularMyDpOptions { return JSON.parse(JSON.stringify(this.myDatePickerOptions)); } }
