|
public onActionComplete(args: ActionEventArgs): void {
if (args.requestType === 'dateNavigate') {
const selectedDate =
this.selectedDate;
const workCells =
this.scheduleObj.element.querySelectorAll('.e-work-cells');
this.applyStylesToCells(workCells, selectedDate);
const headerCells =
this.scheduleObj.element.querySelectorAll('.e-date-header-wrap
.e-header-cells');
this.applyStylesToCells(headerCells, selectedDate);
}
}
private applyStylesToCells(cells:
NodeListOf<Element>, selectedDate: Date): void {
cells.forEach((cell: HTMLElement) => {
const cellDate =
this.scheduleObj.getDateFromElement(cell);
if (cellDate &&
cellDate.getDate() === selectedDate.getDate() &&
cellDate.getMonth() === selectedDate.getMonth() &&
cellDate.getFullYear() === selectedDate.getFullYear()) {
cell.style.backgroundColor = 'lightgray';
} else {
cell.style.backgroundColor = '';
}
});
}
|