agenda change timeline

This commit is contained in:
Peter Maquiran
2023-08-29 16:42:46 +01:00
parent 088ee19e5c
commit 53e6740323
8 changed files with 57 additions and 264 deletions
+9 -7
View File
@@ -16,12 +16,16 @@ export class ListBoxService {
return eventSource.filter((e) => e.profile == profile)
}
getEventInsideRange(eventSource: EventListStore[], rangeStartDate, randEndDate) {
getEventInsideRange(eventSource: EventListStore[], rangeStartDate, randEndDate, selectedDate) {
return eventSource.filter((e)=> {
if(new Date(rangeStartDate).getTime() <= new Date(e.startTime).getTime() &&
new Date(randEndDate).getTime() >= new Date(e.endTime).getTime()) {
new Date(randEndDate).getTime() >= new Date(e.endTime).getTime()) {
return true
} else if ( new Date(selectedDate).getMonth() == new Date(e.endTime).getMonth() ||
new Date(selectedDate).getMonth() == new Date(e.startTime).getMonth()) {
return true
}
return false
})
}
@@ -47,16 +51,14 @@ export class ListBoxService {
if(segment!='Combinado') {
eventSource = this.filterSegment(eventSource, segment)
}
eventSource = this.getEventInsideRange(eventSource, rangeStartDate, randEndDate, selectedDate)
// if(profile != 'all') {
// eventSource = this.filterProfile(eventSource, profile)
// }
let newStracture:CustomCalendarEvent[];
newStracture = this.encapsulation(eventSource);
return this.display(newStracture, selectedDate)
return eventSource
}
display(list: CustomCalendarEvent[], selectedDate) {