Fix event all day

This commit is contained in:
Peter Maquiran
2021-09-02 16:06:53 +01:00
parent dbe6a022f2
commit 1665b2e057
11 changed files with 49 additions and 331 deletions
+14 -23
View File
@@ -26,10 +26,23 @@ export class ListBoxService {
})
}
filterSegment(eventSource: EventListStore[], segment): EventListStore[] {
return eventSource.filter( data => data.calendarName == segment)
}
daysBetween(){ }
list(eventSource: EventListStore[], profile: 'md' | 'pr' | 'all', rangeStartDate, randEndDate, {segment = 'todo'}) {
list(eventSource: EventListStore[], profile: 'md' | 'pr' | 'all', rangeStartDate, randEndDate, {segment = 'Combinado', selectedDate= null}) {
if(selectedDate) {
eventSource = eventSource.filter(data => data.startTime.toLocaleDateString('pt')>= selectedDate.toLocaleDateString('pt'))
}
if(segment!='Combinado') {
eventSource = this.filterSegment(eventSource, segment)
}
if(profile != 'all') {
eventSource = this.filterProfile(eventSource, profile)
}
@@ -49,7 +62,6 @@ export class ListBoxService {
display(list: CustomCalendarEvent[]) {
let days = {};
console.log(list)
list.forEach( (event:CustomCalendarEvent, index)=> {
@@ -127,15 +139,6 @@ export class ListBoxService {
})
setTimeout(()=>{
document.querySelectorAll('.EventListBox-container .EventListBox').forEach((e)=>{
if(e.childElementCount == 0) {
e.parentElement.style.display = 'none'
} else {
e.parentElement.style.display = 'block'
}
})
}, 10)
return days
}
@@ -149,18 +152,10 @@ export class ListBoxService {
events.push({
start: new Date(element.startTime),
end: new Date(element.endTime),
color: {
primary: '#0000',
secondary: '#0000'
},
id: element.id,
index: eventIndex,
CalendarName: element.calendarName,
event: element.event,
});
console.log('element.event', element.event)
});
return events;
@@ -169,14 +164,10 @@ export class ListBoxService {
transForm(event: CustomCalendarEvent, {startMany, endMany, middle}) {
return Object.assign({}, {
title: event.event.Subject,
start: event.start,
end: event.end,
color: event.color,
id: event.id,
index: event.index,
profile: event,
CalendarName: event.CalendarName,
event: {
Subject: event.event.Subject,
StartDate: event.event.StartDate,