Skip to content
Snippets Groups Projects
Verified Commit 87c5896f authored by Dominik's avatar Dominik :scream_cat:
Browse files

[fix] Reload calendar after adding and removing repeating dates

parent 5b699ce0
No related branches found
No related tags found
No related merge requests found
......@@ -98,7 +98,7 @@
<mat-divider></mat-divider>
</mat-list-item>
</mat-list>
<mat-calendar *ngIf="repeats?.length > 0" [dateClass]="isSelected"></mat-calendar>
<mat-calendar *ngIf="repeats?.length > 0 && showCalendar" [dateClass]="isSelected"></mat-calendar>
</div>
</mat-expansion-panel>
</div>
......
......@@ -39,6 +39,7 @@ export class EventCreateComponent implements OnDestroy {
xWeeks = 1;
xRepeats: number;
repeats: any[] = [];
showCalendar = true;
constructor(
private groupsService: GroupsService,
......@@ -118,6 +119,7 @@ export class EventCreateComponent implements OnDestroy {
});
}
form.reset();
this.reloadCalendar();
}
deleteRepeats(repeat) {
......@@ -125,6 +127,14 @@ export class EventCreateComponent implements OnDestroy {
if (i > -1) {
this.repeats.splice(i, 1);
}
this.reloadCalendar();
}
private reloadCalendar() {
this.showCalendar = false;
setTimeout(() => {
this.showCalendar = true;
}, 1);
}
isSelected: MatCalendarCellClassFunction<Date> = (event, view) => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment