Page 1 of 1

[REACT] Remove weekends and start on Monday

Posted: Wed Jul 27, 2022 1:21 pm
by additout

Hi team,

Is it possible to hide the weekends (Saturday and Sunday) so Monday can be first?


Re: [REACT] Remove weekends and start on Monday

Posted: Wed Jul 27, 2022 2:00 pm
by tasnim

Check our docs here: https://bryntum.com/docs/gantt/#Scheduler/data/TimeAxis

use https://bryntum.com/docs/gantt/#Scheduler/data/TimeAxis#function-filterBy

Here is a simple code snippet :

gantt.timeAxis.filter(tick => {
    let weekday = true;
    if (tick.startDate.getDay() == 6 || tick.startDate.getDay() == 0) {
        weekday = false;
    }
    return weekday;
});