Closed JanDa-ma closed 3 years ago
@JanDa-ma Yes. You could customize the monthviewEventDetailTemplate to add any control you want. Check "Template Customization" in README for more details.
Below code shows how to use the custom template.
<ng-template #template let-showEventDetail="showEventDetail" let-selectedDate="selectedDate" let-noEventsLabel="noEventsLabel">
...
</ng-template>
<calendar ... [monthviewEventDetailTemplate]="template"></calendar>
Below code is the default event detail template. You could make the change for your own requirement.
<ng-template #monthviewDefaultEventDetailTemplate let-showEventDetail="showEventDetail" let-selectedDate="selectedDate" let-noEventsLabel="noEventsLabel">
<ion-list class="event-detail-container" has-bouncing="false" *ngIf="showEventDetail" overflow-scroll="false">
<ion-item *ngFor="let event of selectedDate?.events" (click)="eventSelected(event)">
<span *ngIf="!event.allDay" class="monthview-eventdetail-timecolumn">{{event.startTime|date: 'HH:mm'}}
-
{{event.endTime|date: 'HH:mm'}}
</span>
<span *ngIf="event.allDay" class="monthview-eventdetail-timecolumn">{{allDayLabel}}</span>
<span class="event-detail"> | {{event.title}}</span>
</ion-item>
<ion-item *ngIf="selectedDate?.events.length==0">
<div class="no-events-label">{{noEventsLabel}}</div>
</ion-item>
</ion-list>
</ng-template>
@JanDa-ma Yes. You could customize the monthviewEventDetailTemplate to add any control you want. Check "Template Customization" in README for more details.
Below code shows how to use the custom template.
<ng-template #template let-showEventDetail="showEventDetail" let-selectedDate="selectedDate" let-noEventsLabel="noEventsLabel"> ... </ng-template> <calendar ... [monthviewEventDetailTemplate]="template"></calendar>
Below code is the default event detail template. You could make the change for your own requirement.
<ng-template #monthviewDefaultEventDetailTemplate let-showEventDetail="showEventDetail" let-selectedDate="selectedDate" let-noEventsLabel="noEventsLabel"> <ion-list class="event-detail-container" has-bouncing="false" *ngIf="showEventDetail" overflow-scroll="false"> <ion-item *ngFor="let event of selectedDate?.events" (click)="eventSelected(event)"> <span *ngIf="!event.allDay" class="monthview-eventdetail-timecolumn">{{event.startTime|date: 'HH:mm'}} - {{event.endTime|date: 'HH:mm'}} </span> <span *ngIf="event.allDay" class="monthview-eventdetail-timecolumn">{{allDayLabel}}</span> <span class="event-detail"> | {{event.title}}</span> </ion-item> <ion-item *ngIf="selectedDate?.events.length==0"> <div class="no-events-label">{{noEventsLabel}}</div> </ion-item> </ion-list> </ng-template>
Now it works. Thanks!
I would like to have an edit button next to the event name that is listed underneath the calendar. Is that possible to do and how can I do it? Thanks!