Open SergeyMaltsev opened 2 months ago
See
// https://github.com/bryntum/support/issues/9853 t.it('Should redraw non-working ranges on calendars inline assignment', async t => {
in 9853-assign-calendars branch in SchedulerPro/tests/features/NonWorkingTime.t.js
9853-assign-calendars
SchedulerPro/tests/features/NonWorkingTime.t.js
Also sample code Try click Use non-working time intervals few times. Regions will disappear Click handler has line which helps to show regions.
Use non-working time intervals
import SchedulerPro from '../../lib/SchedulerPro/view/SchedulerPro.js'; const calendars = [ { id : 'workhours', name : 'Working hours', unspecifiedTimeIsWorking : true } ]; const calendarsWithIntervals = [ { id : 'workhours', name : 'Working hours', unspecifiedTimeIsWorking : true, intervals : [ { startDate : new Date(2020, 2, 23, 2, 0), endDate : new Date(2020, 2, 23, 4, 0), isWorking : false, cls : 'factoryShutdown', name : 'Factory shutdown' } ] } ]; const scheduler = new SchedulerPro({ project : { calendars : calendarsWithIntervals, calendar : 'workhours' }, appendTo : 'container', startDate : '2020-03-23', endDate : '2020-03-28', viewPreset : 'hourAndDay', columns : [ { field : 'name', text : 'Staff', width : '10em' } ], tbar : [ { ref : 'clearIntervalsCheck', type : 'checkbox', text : 'Use non-working time intervals', checked : true, onChange({ checked }) { scheduler.calendars = checked ? calendarsWithIntervals : calendars; // The line below helps //scheduler.features.nonWorkingTime.attachToCalendar(scheduler.calendar); } } ] });
See
in
9853-assign-calendars
branch inSchedulerPro/tests/features/NonWorkingTime.t.js
Also sample code Try click
Use non-working time intervals
few times. Regions will disappear Click handler has line which helps to show regions.