问题描述
我有 angular bootstrap 日历,我试图将日历下拉设置为仅显示未来 5 年,而不是更多。目前它显示 +10 年和 - 10 年。
解决方法
在 angular bootstrap 中使用 maxDate 函数
在输入标签[maxDate]="maxDate"
在打字稿中
maxDate:any;
inside ngoninit
this.new = Date();
this.maxDate = {year:this.now.maxfullyear()+5,month:1,day:1}