Agenda add functionality to change year and month

This commit is contained in:
Peter Maquiran
2021-09-03 16:37:00 +01:00
parent cc793f2f06
commit 83c6dc4cb2
3 changed files with 30 additions and 2 deletions
+28
View File
@@ -191,6 +191,9 @@ export class AgendaPage implements OnInit {
}, 1000)
window['year'] = this.changeYear
}
ngOnInit() {
@@ -738,6 +741,31 @@ export class AgendaPage implements OnInit {
}
changeYear = (year) => {
const a = this.calendar.currentDate
this.calendar.currentDate = new Date(`${year}-${a.getMonth()}-${a.getDay()}`);
try {
this.myCal.update();
this.myCal.loadEvents();
} catch(e) {}
this.updateEventListBox()
}
changeMonth = (month) => {
const a = this.calendar.currentDate
this.calendar.currentDate = new Date(`${a.getFullYear()}-${month}-${a.getDay()}`);
try {
this.myCal.update();
this.myCal.loadEvents();
} catch(e) {}
this.updateEventListBox()
}
get viewEventMonth () {
return this.viewDate.getMonth()
@@ -40,7 +40,6 @@
</ion-item>
</div>
<div *ngIf="cc!='' && cc!=' ' ">
.. {{ cc | json }} ..
<h5 *ngIf="cc.length > 0">Com conhecimento</h5>
<ion-item *ngIf="cc.length > 0" class="ion-no-margin ion-no-padding">