mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
order list by date in agenda
This commit is contained in:
@@ -6,6 +6,7 @@ import { ModalController } from '@ionic/angular';
|
||||
import { NavigationEnd, Router } from '@angular/router';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
import { LoginUserRespose } from 'src/app/models/user.model';
|
||||
import { SortService } from 'src/app/services/functions/sort.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-event-list',
|
||||
@@ -36,6 +37,7 @@ export class EventListPage implements OnInit {
|
||||
private modalController: ModalController,
|
||||
private router: Router,
|
||||
private userAuth: AuthService,
|
||||
private sortService: SortService,
|
||||
) {
|
||||
this.loggeduser = userAuth.ValidatedUser;
|
||||
}
|
||||
@@ -54,8 +56,8 @@ export class EventListPage implements OnInit {
|
||||
}
|
||||
|
||||
ngOnChanges() {
|
||||
this.LoadToApproveEvents();
|
||||
}
|
||||
//this.LoadToApproveEvents();
|
||||
}
|
||||
|
||||
segmentChanged(ev: any) {
|
||||
this.LoadToApproveEvents();
|
||||
@@ -71,12 +73,21 @@ export class EventListPage implements OnInit {
|
||||
if(this.segment == 'MDGPR'){
|
||||
let mdEventsOficial = await this.processes.GetTasksList('Agenda Oficial MDGPR', false).toPromise();
|
||||
let mdEventsPessoal = await this.processes.GetTasksList('Agenda Pessoal MDGPR', false).toPromise();
|
||||
this.eventsMDGPRList = mdEventsOficial.concat(mdEventsPessoal);
|
||||
|
||||
let allEvents = mdEventsOficial.concat(mdEventsPessoal);
|
||||
if(allEvents.length > 0){
|
||||
this.eventsMDGPRList = this.sortService.sortArrayByDate(allEvents).reverse();
|
||||
}
|
||||
this.showLoader = false;
|
||||
}
|
||||
else if(this.segment == 'PR'){
|
||||
let prEventsOficial = await this.processes.GetTasksList('Agenda Oficial PR', false).toPromise();
|
||||
let prEventsPessoal = await this.processes.GetTasksList('Agenda Pessoal PR', false).toPromise();
|
||||
this.eventsPRList = prEventsOficial.concat(prEventsPessoal);
|
||||
let allEvents = prEventsOficial.concat(prEventsPessoal);
|
||||
console.log(allEvents);
|
||||
if(allEvents.length > 0){
|
||||
this.eventsPRList = this.sortService.sortArrayByDate(allEvents).reverse();
|
||||
}
|
||||
}
|
||||
this.showLoader = false;
|
||||
}
|
||||
@@ -95,6 +106,10 @@ export class EventListPage implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
refreshing() {
|
||||
this.LoadToApproveEvents();
|
||||
}
|
||||
|
||||
doRefresh(event) {
|
||||
this.LoadToApproveEvents();
|
||||
console.log('refresh');
|
||||
|
||||
Reference in New Issue
Block a user