fix: if isExcludedWeeks or weeks is null then pass condition

This commit is contained in:
Polianin Nikita 2024-08-28 00:00:46 +03:00
parent 49179d2a8a
commit fc828f3008

View File

@ -73,9 +73,12 @@ export class TableComponent implements OnChanges {
x.dayOfWeek === k && x.dayOfWeek === k &&
x.isEven === (this.currentWeek % 2 === 0) && x.isEven === (this.currentWeek % 2 === 0) &&
( (
(x.isExcludedWeeks && (!x.weeks || !x.weeks.includes(this.currentWeek))) || x.isExcludedWeeks === undefined ||
(!x.isExcludedWeeks && (!x.weeks || x.weeks.includes(this.currentWeek))) x.weeks === undefined ||
)); (x.isExcludedWeeks && (!x.weeks.includes(this.currentWeek))) ||
(!x.isExcludedWeeks && (x.weeks.includes(this.currentWeek)))
)
);
} }
tableData.push(convertedData); tableData.push(convertedData);