简体   繁体   English

如何隐藏 Angular 日历上的日期?

[英]How to hide dates on Angular Calendar?

I'm using Angular 12.0 Calendar and I want to hide the text that shows the day of the month on week view.我正在使用 Angular 12.0 Calendar,我想隐藏在周视图中显示月份日期的文本。 I've dug through the code and tried looking online but can't find the location of what makes this text appear.我仔细研究了代码并尝试在线查找,但无法找到使此文本出现的位置。 I am talking about this one https://mattlewis92.github.io/angular-calendar/#/kitchen-sink我说的是这个https://mattlewis92.github.io/angular-calendar/#/kitchen-sink

not to be confused with material's.不要与材料混淆。

example例子

Might be a bit late, but today I needed the same thing and I came out with this.可能有点晚了,但今天我需要同样的东西,我想出了这个。 Docs might be hard to read, but you can find that almost every component inside the Angular Calendar has a templateRef (check this out: https://mattlewis92.github.io/angular-calendar/docs/components/CalendarWeekViewComponent.html#headerTemplate ).文档可能难以阅读,但您会发现 Angular Calendar 中的几乎每个组件都有一个 templateRef(查看: https://mattlewis92.github.io/angular-calendar/docs/components/CalendarWeekViewComponent.html#headerTemplate ).

 <mwl-calendar-week-view [viewDate]="viewDate" [events]="events" [hourSegmentTemplate]="weekViewHourSegmentTemplate" [headerTemplate]="noDateHeaderTemplate" (eventTimesChanged)="eventTimesChanged($event)" (eventClicked)="eventClicked($event)"> </mwl-calendar-week-view>

After that you need to set [headerTemplate] to a local ng-template.之后,您需要将 [headerTemplate] 设置为本地 ng-template。 Personally I copied the default template hosted in the repo (you can find it here: https://github.com/mattlewis92/angular-calendar/blob/main/projects/angular-calendar/src/modules/week/calendar-week-view-header.component.ts我个人复制了 repo 中托管的默认模板(你可以在这里找到它: https://github.com/mattlewis92/angular-calendar/blob/main/projects/angular-calendar/src/modules/week/calendar-week -view-header.component.ts

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM