我正在尝试为primeNG日历上的某些禁用日期添加样式,在文档中建议使用disabledDateTemplate。但是,这似乎不起作用,我也无法在线找到一个解决方案。
答案 0 :(得分:0)
您可以像这样覆盖失效日期的样式
style.css
p-calendar td span.p-disabled {
color: red !important;
background: orange !important
}
或者您可以设置一个自定义类,以便样式不会影响所有组件
模板
<p-calendar styleClass="custom-theme"
[(ngModel)]="dateValue"
[disabledDates]="invalidDates"
[disabledDays]="[0,6]"
[readonlyInput]="true">
</p-calendar>
style.css
p-calendar .custom-theme td span.p-disabled {
color: #fff !important;
background: darkred !important
}