This commit is contained in:
Peter Maquiran
2024-03-02 18:12:57 +01:00
parent 65dac392e7
commit 3204403058
2 changed files with 27 additions and 5 deletions
+3 -2
View File
@@ -230,9 +230,10 @@
<!-- {{ month.monthInfo.monthName | json }} -->
<!-- <hr> -->
<div *ngFor="let day of month.days " class="EventListBox-container" >
<div *ngFor="let day of month.days; let i = index " class="EventListBox-container" >
<div class="day" *ngIf="!(i == 0 && isSelectedDayHasEvent)" >
<div class="day " [class.dayShow]="isSelectedDayHasEvent && hasEventToday" >
{{ day.daysInfo.dayName }} <div style="text-transform: capitalize; display: inline;">{{month.monthInfo.monthName}}</div>
</div>
+24 -3
View File
@@ -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)