Our pure JavaScript Scheduler component


Post by tomerPlanit »

Hi,
I work with scheduler 4.3.3 and angular 13.

I am trying to hide days in the scheduler, the days not come one after other so I canot use:

scheduler.instance.workingTime

I tried to filter the scheduler time axis like this:

  scheduler.instance.timeAxis.addFilter((tick) => {
    const day = (tick.startDate as Date).getDay() 
      return day !== 0 &&  day!==3;
    })

It works but stuck the scroll event.

What is the right way to implement this flow of hide days(that not stuck the scroll)?


Post by mats »

It works but stuck the scroll event.

Please describe a bit further what does not work?

See this demo for many different configurations of non-continuous time axes: https://bryntum.com/examples/scheduler/timeaxis/


Post by tomerPlanit »

Hi mats,
I implement the hide days feature like SchedulerFilterableTimeAxis demo.
The scroll action stuck solved when I added :

scheduler.instance.timeAxis.continuous = false

My filter code:

 // Hide days in time lines by masc.
    private hideSchedulerDays(hideDayMask: number) {
    
// Get number and turn to days(return days array [1,0,0,0,0,1,0]=[Sunday,Thursday]) const hideDays: number[] = this.dateService.getDaysByMask(hideDayMask); // @ts-ignore this.scheduler.instance.timeAxis.continuous = false; this.scheduler.instance.timeAxis.beginBatch(); this.scheduler.instance.timeAxis.filter({ filters: (tick) => hideDays[(tick.startDate as Date).getDay()] !== 1, replace: true }); this.scheduler.instance.timeAxis.endBatch(); }

But I got different error on large zoom:

core.mjs:6495 ERROR Error: Invalid time axis configuration or filter, please check your input data.
at TimeAxis.internalOnReconfigure (scheduler.lite.umd.js:133517)
at TimeAxis.reconfigure (scheduler.lite.umd.js:133475)
at Scheduler.updateViewPreset (scheduler.lite.umd.js:179290)
at Scheduler.set (scheduler.lite.umd.js:3320)
at Scheduler.zoomToLevel (scheduler.lite.umd.js:179750)
at Scheduler.set zoomLevel [as zoomLevel] (scheduler.lite.umd.js:179612)
at TimeAxisHeaderMenu.onZoomSliderChange (scheduler.lite.umd.js:153666)
at Slider.trigger (scheduler.lite.umd.js:47061)
at Slider.onInternalInput (scheduler.lite.umd.js:73834)
at HTMLInputElement.handler (scheduler.lite.umd.js:31602)

screen-capture (1).gif
screen-capture (1).gif (7.23 MiB) Viewed 486 times

As I can see the same error happens in the time axis filter demo:

screen-capture (2).gif
screen-capture (2).gif (8.16 MiB) Viewed 486 times

Post by alex.l »

There is a bug, thank you a lot for clear steps to reproduce, we will figure it out, here is a link to track the status: https://github.com/bryntum/support/issues/3866

All the best,
Alex


Post by andrew.perera »

Hi Alex,
Howdy, just wondering whether this ticket is fixed for 5.1.0. We have a similar issue in the React code.

Thanks.


Post by tasnim »

Hi,
This bug was not fixed in 5.1.0. As it has 5.1.x milestone It might be available on one of our nearest patch releases. Please subscribe to the ticket, so that you'll get notified when the ticket is fixed.

Good Luck :),
Tasnim


Post Reply