Hi,
[I'm using 5.3.0-beta-1 scheduler pro, but this also occurs in 5.2.8.]
I have this time axis which is supplied as a prop to BryntumSchedulerPro:
export const timeAxis: Partial<TimeAxisConfig> = {
filters: [
(tick: any) => {
return ![0, 6].includes(tick.startDate.getDay());
}
]
};
...
export const staticSchedulerProConfig: Partial<BryntumSchedulerProProps> = {
...
timeAxis
...
}
...
<BryntumSchedulerPro ref={schedulerProRef} project={projectRef} {...staticSchedulerProConfig} />
...
This produces very weird results and makes random dates disappear. After several zoom in/zoom out operations (using SchedulerBase.zoomIn/zoomOut
) I end up missing whole months or quarters and timeline shifts left (back in time) on every zoom operation (I ended up in 19th century after several zoom in/out)
I tried alternative approach to setting time axis filter using https://bryntum.com/products/schedulerpro-next/docs/api/Scheduler/data/TimeAxis#function-filterBy:
const schedulerProRef = useRef<BryntumSchedulerPro>(null);
const schedulerPro = () => schedulerProRef.current?.instance as SchedulerPro;
const schedulerProValue = schedulerPro();
useEffect(() => {
if (schedulerProValue) {
const f = async () => {
await schedulerProValue.timeAxis.clearFilters();
await schedulerProValue.timeAxis.filterBy((t: any) => ![0, 6].includes(t.startDate.getDay()));
};
f();
}
}, [schedulerProValue]);
to the same effect.
In fact, settings any filter (even noop () => true
) produces similar results (timeline shifts left, however I haven't noticed any missing dates in that case), so it's not about that particular filter function.
Am I missing something? What's the correct way to use time axis filters with React?
Cheers,
Tomek