Improve agenda loadtime

This commit is contained in:
Peter Maquiran
2021-05-06 10:40:52 +01:00
parent 0ede8c4607
commit 75f9d789fd
+5 -2
View File
@@ -777,7 +777,6 @@ export class AgendaPage implements OnInit {
this.eventService.getAllMdEvents( momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59') ).subscribe( this.eventService.getAllMdEvents( momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59') ).subscribe(
response => { response => {
this.TimelineMD = [];
if(this.segment == 'Oficial') { if(this.segment == 'Oficial') {
this.eventsList = response.filter(data => data.CalendarName == "Oficial"); this.eventsList = response.filter(data => data.CalendarName == "Oficial");
@@ -803,6 +802,7 @@ export class AgendaPage implements OnInit {
profile: 'md', profile: 'md',
id: element.EventId, id: element.EventId,
}); });
}); });
const MDEventList = this.timelineFilter(this.timelineFilterState, this.eventsList, 'md'); const MDEventList = this.timelineFilter(this.timelineFilterState, this.eventsList, 'md');
@@ -827,7 +827,6 @@ export class AgendaPage implements OnInit {
this.eventService.getAllPrEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).subscribe( this.eventService.getAllPrEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).subscribe(
response => { response => {
this.TimelinePR = [];
if(this.segment == 'Oficial') { if(this.segment == 'Oficial') {
this.eventsList = response.filter(data => data.CalendarName == "Oficial"); this.eventsList = response.filter(data => data.CalendarName == "Oficial");
@@ -891,8 +890,12 @@ export class AgendaPage implements OnInit {
return e.startTime.toLocaleDateString('en-US') == this.eventSelectedDate.toLocaleDateString('en-US'); return e.startTime.toLocaleDateString('en-US') == this.eventSelectedDate.toLocaleDateString('en-US');
}); });
console.log('Event -- ',filterDate[filterDate.length - 1]);
const firstEventStartHours = new Date(filterDate[filterDate.length - 1].startTime).getHours(); const firstEventStartHours = new Date(filterDate[filterDate.length - 1].startTime).getHours();
console.log('firstEventStartHours-- ', firstEventStartHours)
const scrollContainer = document.querySelector('.timeline-wrapper'); const scrollContainer = document.querySelector('.timeline-wrapper');
scrollContainer.scroll({ scrollContainer.scroll({