Last active
May 6, 2020 14:34
-
-
Save armorpreston/7f70a920e05b605f686412015f19f82a to your computer and use it in GitHub Desktop.
Disabling Dates
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<date-picker [markDisabled]="markDateDisabled.bind(this)"></date-picker> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class DatePickerExamplesComponent { | |
public now = new Date(); | |
public today: NgbDate = new NgbDate(this.now.getFullYear(), this.now.getMonth() + 1, this.now.getDate()); | |
public markDateDisabled(date: NgbDate): boolean { | |
// Disable dates before today – date.after(this.today) is also available | |
return date.before(this.today); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment