From 320440305829f6831266151df0661f73e2069e90 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Sat, 2 Mar 2024 18:12:57 +0100 Subject: [PATCH] fix --- src/app/pages/agenda/agenda.page.html | 5 ++-- src/app/services/agenda/list-box.service.ts | 27 ++++++++++++++++++--- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/src/app/pages/agenda/agenda.page.html b/src/app/pages/agenda/agenda.page.html index a06bfde06..aa03c4cd4 100644 --- a/src/app/pages/agenda/agenda.page.html +++ b/src/app/pages/agenda/agenda.page.html @@ -230,9 +230,10 @@ -
+
+ +
-
{{ day.daysInfo.dayName }}
{{month.monthInfo.monthName}}
diff --git a/src/app/services/agenda/list-box.service.ts b/src/app/services/agenda/list-box.service.ts index 5f8335b3c..f6f9c9eb8 100644 --- a/src/app/services/agenda/list-box.service.ts +++ b/src/app/services/agenda/list-box.service.ts @@ -105,6 +105,7 @@ export class ListBoxService { } display(list: CustomCalendarEvent[], selectedDate) { + // console.log("==================!====================================================") let days = {}; const year: Year[] = [] @@ -138,7 +139,10 @@ export class ListBoxService { const StartEvent = this.transForm(event, {startMany: true, endMany: false, middle: false}) - if(this.CanPush(event, selectedDate)) {days[day].push(StartEvent); this.push(StartEvent, year)} + if(this.CanPush(event, selectedDate)) { + // console.log({days: 'days1', StartEvent}) + days[day].push(StartEvent); this.push(StartEvent, year) + } let i = 1; @@ -163,12 +167,19 @@ export class ListBoxService { startDate.getDate() != endDate.getDate())) { // last push const EndEvent = this.transForm(event, {startMany: false, endMany: true, middle: false}) - if(this.CanPush(event, selectedDate)) {days[otherDays].push(EndEvent) ; this.push(event, year)} + if(this.CanPush(event, selectedDate)) { + // console.log({days: 'days2', event}) + days[otherDays].push(EndEvent) ; this.push(event, year) + } } else { const EndEvent = this.transForm(event, {startMany: false,endMany: true, middle: true}) - if(this.CanPush(event, selectedDate)) {days[otherDays].push(EndEvent) ; this.push(event, year)} + if(this.CanPush(event, selectedDate)) { + // console.log({days: 'days3', event}) + days[otherDays].push(EndEvent) ; this.push(event, year) + } + } days[otherDays] = days[otherDays].reverse() @@ -189,6 +200,7 @@ export class ListBoxService { }) + // console.log({days}) // remove days that haven't event Object.entries(days).forEach(([index, value]) => { const _value: any = value @@ -256,6 +268,15 @@ export class ListBoxService { CanPush(event: any, selectedDate: Date) { + const cloneSelectedDate = new Date(selectedDate); + + cloneSelectedDate.setHours(0) + cloneSelectedDate.setMinutes(0) + cloneSelectedDate.setSeconds(0) + + console.log({event}) + + const limite = this.endOfMonth(selectedDate) limite.setDate(limite.getDate() + 10) limite.setHours(0)