[英]Disable future dates in Formly Datepicker in Angular
I am using Formly with Material in Angular and have a datepicker.我在 Angular 中使用 Formly 和 Material 并有一个日期选择器。 All I want to do is disable future dates so they cannot be selected when selecting a date, I can't seem to find anything online!我想要做的就是禁用未来的日期,以便在选择日期时无法选择它们,我似乎在网上找不到任何东西!
export class AppComponent {
form = new FormGroup({});
model: any = {};
options: FormlyFormOptions = {};
fields: FormlyFieldConfig[] = [
{
key: 'Datepicker',
type: 'datepicker',
templateOptions: {
label: 'Datepicker',
placeholder: 'Placeholder',
description: 'Description',
required: true,
//what to put here to disable future dates?
},
},
];
}
You can play around with the code here: https://stackblitz.com/angular/gkyxqxygybo?file=src%2Fapp%2Fapp.component.ts您可以在此处使用代码: https : //stackblitz.com/angular/gkyxqxygybo?file=src%2Fapp%2Fapp.component.ts
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.