Primeng中的p日历的自定义按钮
我试图集成自定义按钮除了今天和p-calendar.Is清除有没有办法呢?另外,如何将“Clear”标签更改为“Empty”之类的内容?Primeng中的p日历的自定义按钮
感谢
回答:
要更改清除标签,只需使用locale
属性(见本地化部分来自doc)。
要添加自定义按钮,您可以添加自定义模板(请参阅自定义内容部分来自同一文档)。
<p-calendar [(ngModel)]="dateValue" showButtonBar="true" [locale]="en"> <p-footer>Cutom footer with custom buttons</p-footer>
</p-calendar>
和
en: any; ngOnInit() {
this.en = {
firstDayOfWeek: 0,
dayNames: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
dayNamesShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
dayNamesMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
monthNames: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
today: 'Today',
clear: 'Clear it !!!'
};
}
以上是 Primeng中的p日历的自定义按钮 的全部内容, 来源链接: utcz.com/qa/261313.html