Angular 12 kendo-datepicker 禁用过去的日期
Angular 12 kendo-datepicker disable past dates
我想在 Kendo 日期选择器中禁用过去的日期。我该怎么办?
<kendo-datepicker [(value)]="oneTime.startDate" [disabled]="disableDates()"></kendo-datepicker>
disableDates() {
//return (this.currentDate.getTime() (new Date()).getTime());
}
<kendo-datepicker [(value)]="startDate" [disabledDates]="disabledDates"></kendo-datepicker>
public disabledDates = (date: Date): boolean => {
const yesterday = (d => new Date(d.setDate(d.getDate() - 1)))(new Date);
return (date.getTime() < yesterday.getTime());
};
我想在 Kendo 日期选择器中禁用过去的日期。我该怎么办?
<kendo-datepicker [(value)]="oneTime.startDate" [disabled]="disableDates()"></kendo-datepicker>
disableDates() {
//return (this.currentDate.getTime() (new Date()).getTime());
}
<kendo-datepicker [(value)]="startDate" [disabledDates]="disabledDates"></kendo-datepicker>
public disabledDates = (date: Date): boolean => {
const yesterday = (d => new Date(d.setDate(d.getDate() - 1)))(new Date);
return (date.getTime() < yesterday.getTime());
};