diff --git a/Mohem/src/app/hmg-common/ui/circle-calendar/circle-calendar.component.ts b/Mohem/src/app/hmg-common/ui/circle-calendar/circle-calendar.component.ts index c664d3dc..842cbd83 100644 --- a/Mohem/src/app/hmg-common/ui/circle-calendar/circle-calendar.component.ts +++ b/Mohem/src/app/hmg-common/ui/circle-calendar/circle-calendar.component.ts @@ -17,11 +17,6 @@ import { GetSwipesRequest } from 'src/app/time-card/service/models/get-swipes-re styleUrls: ['./circle-calendar.component.scss'] }) export class CircleCalendarComponent implements OnInit { - - @Input() eventsdateDayOff: any = []; - @Input() eventsdateAttend: any = []; - @Input() eventsdateAbsent: any = []; - @Input() normalDays: any = []; @Input() dayHoursTypeDetailsList: any = []; @Input() currentDateParent: string; @Output() monthTitle = new EventEmitter(); @@ -86,10 +81,7 @@ export class CircleCalendarComponent implements OnInit { } reRenderCalendar() { - this.renderDate(this.eventsdateAbsent, 'absent'); - this.renderDate(this.eventsdateAttend, 'present'); - this.renderDate(this.eventsdateDayOff, 'dayoff'); - this.renderDate(this.normalDays, 'scheduleDay'); + this.renderDate(this.dayHoursTypeDetailsList); } public async dateModal(shiftDetails) { @@ -106,14 +98,23 @@ export class CircleCalendarComponent implements OnInit { await modal.present(); } - public renderDate(arrayDays, cssClass) { + public renderDate(arrayDays) { const td = document.querySelectorAll('.swiper-slide-active .monthview-datetable td:not(.text-muted)'); arrayDays.forEach(dateObj => { - const date = dateObj.startTime; + const date = dateObj.customScheduleDate; td.forEach(element => { // tslint:disable-next-line: triple-equals - if (date.getDate() == element.textContent.trim()) { - element.classList.add(cssClass); + if (date.getDate() == element.textContent.trim() && dateObj.customPresent === true) { + element.classList.add('present'); + // tslint:disable-next-line: triple-equals + } else if (date.getDate() == element.textContent.trim() && dateObj.customAbsent === true) { + element.classList.add('absent'); + // tslint:disable-next-line: triple-equals + } else if (date.getDate() == element.textContent.trim() && dateObj.customDaysOff === true) { + element.classList.add('dayoff'); + // tslint:disable-next-line: triple-equals + } else if (date.getDate() == element.textContent.trim() && dateObj.customSchedule === true) { + element.classList.add('scheduleDay'); } }); }); @@ -124,7 +125,7 @@ export class CircleCalendarComponent implements OnInit { console.log(event.selectedTime.getDate()); const selectedIndex = event.selectedTime.getDate(); this.selectedIndexData = this.dayHoursTypeDetailsList[selectedIndex - 1]; - if (this.selectedIndexData.present) { + if (this.selectedIndexData.customPresent) { const rtpID = this.selectedIndexData.RTP_ID; this.getScheduleShiftDetails(rtpID); } diff --git a/Mohem/src/app/hmg-common/ui/circle-calendar/date-info-modal/date-info-modal.component.scss b/Mohem/src/app/hmg-common/ui/circle-calendar/date-info-modal/date-info-modal.component.scss index 10600f8b..7f648459 100644 --- a/Mohem/src/app/hmg-common/ui/circle-calendar/date-info-modal/date-info-modal.component.scss +++ b/Mohem/src/app/hmg-common/ui/circle-calendar/date-info-modal/date-info-modal.component.scss @@ -78,7 +78,7 @@ height: 360px !important; margin-bottom: -13px !important; color: black !important; font-weight: bold !important; - font-size: 15px !important; + font-size: 14px !important; margin-top: 8px; text-align: center; display: block; diff --git a/Mohem/src/app/hmg-common/ui/employee-information/employee-information.component.html b/Mohem/src/app/hmg-common/ui/employee-information/employee-information.component.html index f3099eaa..a90e4704 100644 --- a/Mohem/src/app/hmg-common/ui/employee-information/employee-information.component.html +++ b/Mohem/src/app/hmg-common/ui/employee-information/employee-information.component.html @@ -1,6 +1,6 @@