P-日历maxDate和maxDate值未实时更新
Html
<p-calendar (onSelect)="_loadTimeSlot()" [readonlyInput]="true" [(maxDate)]="maxDateSat" [(minDate)]="minDateSat" class="pc-f-calendar" inputId="timeSlotDate" formControlName="timeSlotDate"
[dateFormat]="calendarDateFormat" [locale]="calendarLocale" [placeholder]="calendarHolder" appendTo="body" showIcon="true"
[showOnFocus]="true" [monthNavigator]="true" [yearNavigator]="true" yearRange="1970:2100">
</p-calendar>TS
this.minDateSat = new Date(gs.minDt);
this.maxDateSat = new Date(gs.maxDt);
console.log("this.minDateSat >> ",this.minDateSat);
console.log("this.maxDateSat >> ",this.maxDateSat);在输入脚本中,能够看到更新的值。但是UI看不到更新后的最小和最大日期。下一次使用以前的值调用它的更新。
发布于 2020-01-04 17:07:53
将此[(maxDate)]="maxDateSat"更改为此[maxDate]="maxDateSat"
<p-calendar (onSelect)="_loadTimeSlot()"
[readonlyInput]="true" [maxDate]="maxDateSat" [minDate]="minDateSat"
class="pc-f-calendar" inputId="timeSlotDate" formControlName="timeSlotDate"
[dateFormat]="calendarDateFormat" [locale]="calendarLocale" [placeholder]="calendarHolder" appendTo="body"
showIcon="true" [showOnFocus]="true" [monthNavigator]="true" [yearNavigator]="true" yearRange="1970:2100">
</p-calendar>https://stackoverflow.com/questions/59572981
复制相似问题