Hi,
I've got a problem filtering out non working time for intervals that are not aligned with the tick marks of the time axis. The following function does the filtering.
/** Filter non-working days */
public filterNonWorkingDays(): void {
if (this.filterNonWorkingTime) {
/** Hide non-wirking time */
this.scheduler.timeAxis.filter((t) => this.scheduler.project.calendar.isWorkingTime(t.startDate, t.endDate));
} else {
/** Show non-wirking time */
this.scheduler.timeAxis.clearFilters();
}
}
However, the implementation isn't all that good, since timeAxis ticks and non workings time intervals must line up to filter as intended. If they aren't we are left with small snippets of non working time with the filter on.
Suppose we have a activated the filter and the lowest tick mark/time axis granularity is 1 hour. If our work time interval is then set to 08:30AM - 03:00PM we are still left with 30 min non working time in the morning.
Without Filter:
With Filter:
Do you have a better idea or a solution to the problem?
The filter function we have implemented now, is from one of your examples.
The problem only gets worse when zooming out for larger tick mark intervals.
Kind regards, Exigo