|
|
@@ -141,6 +141,8 @@ export class ScheduleActivitiesComponent implements OnInit{
|
|
|
if (!responseData.error) {
|
|
|
this.arrScheduleActivities = responseData.response;
|
|
|
this.dataSource.data = responseData.response;
|
|
|
+ console.log(responseData.response);
|
|
|
+
|
|
|
this.setValueRow();
|
|
|
|
|
|
this.dateSelected.setValue(moment());
|
|
|
@@ -301,14 +303,22 @@ export class ScheduleActivitiesComponent implements OnInit{
|
|
|
let fechaInicio: Date = this.resourcesService.formatStrDateToDate(activityEmployeeElement.FECHA_INICIO);
|
|
|
let fechaFinal: Date = this.resourcesService.formatStrDateToDate(activityEmployeeElement.FECHA_FINAL);
|
|
|
let diffDays = (fechaFinal.getTime() - fechaInicio.getTime()) / (1000*60*60*24) + 1;
|
|
|
- for (let index = 0; index < diffDays; index++) {
|
|
|
- let compareDate: Date = new Date( fechaInicio.getFullYear(), fechaInicio.getMonth(), fechaInicio.getDate() + index );
|
|
|
- if ( compareDate >= this.startDateWeek && compareDate <= this.endDateWeek ) {
|
|
|
- this.setColorCell(index, rowEmployee, activityEmployeeElement.COLOR);
|
|
|
- } else {
|
|
|
- this.setColorCell(index, rowEmployee, "#FFFFFF");
|
|
|
- }
|
|
|
+
|
|
|
+ for (let days = 0; days < diffDays; days++) {
|
|
|
+ let dayDifference: Date = new Date( fechaInicio.getFullYear(), fechaInicio.getMonth(), fechaInicio.getDate() + days );
|
|
|
+ // console.log(dayDifference);
|
|
|
+
|
|
|
+ this.arrWeek.map((week: string, index: number) => {
|
|
|
+ let dateOfWeek: Date = new Date( this.startDateWeek.getFullYear(), this.startDateWeek.getMonth(), this.startDateWeek.getDate() + index );
|
|
|
+
|
|
|
+ if (dateOfWeek.getTime() === dayDifference.getTime()) {
|
|
|
+ console.log(index);
|
|
|
+ console.log(dateOfWeek);
|
|
|
+ this.setColorCell(index, rowEmployee, activityEmployeeElement.COLOR);
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
+
|
|
|
} else if (activityEmployeeElement.PERIODICIDAD === 'SE') {
|
|
|
let fechaInicio: Date = this.resourcesService.formatStrDateToDate(activityEmployeeElement.FECHA_INICIO);
|
|
|
let weekSelect = fechaInicio.getDay();
|