Hi Guys,
I am trying to add some final touches to my implementation of Scheduler component with https://www.bryntum.com/examples/scheduler/resourcetimeranges/, but they are not shown.
Scheduler Version is 4.0.3
My usecase:
Scheduler.component.ts
@Input() resourceTimeRangesFeature = true;
<bry-scheduler
[events]="schedulerEvents$ | async"
[resources]="resources"
[resourceTimeRanges]="resourceVacations"
Approach 1: Setting resourceTimeRanges as Array with matching resourceId
this.resourceVacations = [{
id: 1,
resourceId: 666,
startDate: '2020-01-14',
duration: 2,
durationUnit : 'd',
timeRangeColor : 'red',
name: 'Test'
}];
Approach 2.
@ViewChild(SchedulerComponent, { static: false }) scheduler: SchedulerComponent;
const scheduler = this.scheduler.schedulerInstance as any;
scheduler.resourceTimeRangeStore.add({
name : 'New time range',
startDate : new Date(2020, 0, 14),
duration : 20,
durationUnit : 'h',
timeRangeColor : 'green',
resourceId : 666
});
Result is still the same, timerange is not displayed, am I missing something?
Thanks
Could you please zip up a runnable test case for us so we can debug it?
Tired of debugging javascript errors in web applications? Try our powerful error logging service RootCause
The time range year value is wrong. The time line shows 2021 and the time range is for 2020. Please update your data:
this.resourceVacations = [{
id: 1,
resourceId: 1070,
startDate: '2021-01-14', // 2020 => 2021
duration: 2,
durationUnit: 'd',
timeRangeColor: 'red',
name: 'Test'
}];
Cheers!
Pavel Miklashevich - Core Developer