mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
Add event counter in home page
This commit is contained in:
@@ -12,6 +12,7 @@ import { AuthConnstants } from 'src/app/config/auth-constants';
|
||||
import { ModalController } from '@ionic/angular';
|
||||
import { EventDetailPage } from './event-detail/event-detail.page';
|
||||
import { EventDetailModalPage } from './event-detail-modal/event-detail-modal.page';
|
||||
import { ProcessesService } from '../../services/processes.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-events',
|
||||
@@ -46,6 +47,7 @@ export class EventsPage implements OnInit {
|
||||
combinedEvents: Event[];
|
||||
|
||||
customText = false;
|
||||
totalEvent=0;
|
||||
|
||||
showLoader: boolean;
|
||||
|
||||
@@ -65,7 +67,21 @@ export class EventsPage implements OnInit {
|
||||
//Initialize profile as mdgpr
|
||||
this.profile = "mdgpr";
|
||||
console.log(this.profile);
|
||||
|
||||
|
||||
// set event list
|
||||
if(this.profile == "mdgpr"){
|
||||
this.eventService.getAllMdEvents(formatDate(new Date(), 'yyyy-MM-dd', 'pt') + ' 00:00:00', formatDate(new Date(), 'yyyy-MM-dd', 'pt') + ' 23:59:59').subscribe(res => {
|
||||
this.eventsList = res;
|
||||
this.totalEvent = this.eventsList.length;
|
||||
});
|
||||
}
|
||||
else{
|
||||
this.eventService.getAllPrEvents(formatDate(new Date(), 'yyyy-MM-dd', 'pt') + ' 00:00:00', formatDate(new Date(), 'yyyy-MM-dd', 'pt') + ' 23:59:59').subscribe(res => {
|
||||
this.eventsList = res;
|
||||
this.totalEvent = this.eventsList.length;
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
this.showGreeting();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user