diff --git a/src/app/pages/agenda/agenda.page.ts b/src/app/pages/agenda/agenda.page.ts index 924ba236d..e4fb79e1d 100644 --- a/src/app/pages/agenda/agenda.page.ts +++ b/src/app/pages/agenda/agenda.page.ts @@ -634,7 +634,7 @@ export class AgendaPage implements OnInit { this.rangeEndDate = endTime this.showLoader = true; - const selectedCalendarIds = this.getSelectedAgendaCalendars(); + const selectedCalendarIds = this.removeDuplicatesByOwnerUserId(this.getSelectedAgendaCalendars()); this.listToPresent = this.CalendarStore.getEventsByCalendarIds(selectedCalendarIds) // this.calendar.currentDate.setDate(1); @@ -647,9 +647,14 @@ export class AgendaPage implements OnInit { let load = 0; - for (const selectedCalendar of this.removeDuplicatesByOwnerUserId(selectedCalendarIds)) { + for (const selectedCalendar of selectedCalendarIds) { - const response = await this.AgendaDataRepositoryService.EventList({userId: selectedCalendar.OwnerUserId, calendarOwnerName: selectedCalendar['FullName'] }) + const response = await this.AgendaDataRepositoryService.EventList({ + userId: selectedCalendar.OwnerUserId, + calendarOwnerName: selectedCalendar['FullName'], + endDate: endTime.toISOString(), + startDate: startTime.toISOString() + }) if(response.isOk()) { let label; @@ -668,11 +673,11 @@ export class AgendaPage implements OnInit { this.CalendarStore.pushEvent(eventsList, label, selectedCalendar.OwnerUserId); this.listToPresent = this.CalendarStore.getEventsByCalendarIds(selectedCalendarIds) - // console.log('this.listToPresent', this.listToPresent) + this.showTimelinePR = true; load++ - if (load == selectedCalendarIds.length) { + if (load ==(selectedCalendarIds).length) { this.showLoader = false; } @@ -681,7 +686,7 @@ export class AgendaPage implements OnInit { this.updateEventListBox() } else { load++ - if (load == selectedCalendarIds.length) { + if (load == (selectedCalendarIds).length) { this.showLoader = false; } @@ -769,8 +774,9 @@ export class AgendaPage implements OnInit { updateEventListBox() { const selectedCalendarIds = this.getSelectedAgendaCalendars(); - this.listToPresent = this.CalendarStore.getEventsByCalendarIds(selectedCalendarIds) + this.listToPresent = this.removeDuplicatesByOwnerUserId(this.CalendarStore.getEventsByCalendarIds(selectedCalendarIds)) + console.log('this.listToPresent', JSON.stringify(this.listToPresent) ) const year = this.listBoxService.list(this.listToPresent, 'md', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate }) this.TimelineMDList = year diff --git a/src/app/store/calendar.service.ts b/src/app/store/calendar.service.ts index 9484db497..42231d08e 100644 --- a/src/app/store/calendar.service.ts +++ b/src/app/store/calendar.service.ts @@ -71,6 +71,8 @@ export class CalendarService { } return true }) + + } pushEvent(eventsList: EventList, profile: 'pr' | 'md', CalendarId: string) {