This commit is contained in:
Peter Maquiran
2023-08-29 16:57:01 +01:00
parent ae105eaf0e
commit 8030e4e53f
5 changed files with 115 additions and 48 deletions
+7 -9
View File
@@ -16,16 +16,12 @@ export class ListBoxService {
return eventSource.filter((e) => e.profile == profile)
}
getEventInsideRange(eventSource: EventListStore[], rangeStartDate, randEndDate, selectedDate) {
getEventInsideRange(eventSource: EventListStore[], rangeStartDate, randEndDate) {
return eventSource.filter((e)=> {
if(new Date(rangeStartDate).getTime() <= new Date(e.startTime).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()) {
new Date(randEndDate).getTime() >= new Date(e.endTime).getTime()) {
return true
}
return false
})
}
@@ -51,14 +47,16 @@ 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)
// }
return eventSource
let newStracture:CustomCalendarEvent[];
newStracture = this.encapsulation(eventSource);
return this.display(newStracture, selectedDate)
}
display(list: CustomCalendarEvent[], selectedDate) {