Our pure JavaScript Scheduler component


Post by sanid »

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


Post by mats »

Could you please zip up a runnable test case for us so we can debug it?


Post by sanid »

Hi Mats,

Sure, its in the attachment.

All of the action happens in app.component.ts ngOnInit() method.

Note: node: 14.2.0v, scheduler: 4.0.3

Thanks

(Attachment removed because Bryntum sources were added to the archive)


Post by pmiklashevich »

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'
    }];
Снимок экрана 2021-01-15 в 19.20.13.png
Снимок экрана 2021-01-15 в 19.20.13.png (68.83 KiB) Viewed 728 times

Cheers!

Pavlo Miklashevych
Sr. Frontend Developer


Post by sanid »

Thanks guys,
This is awkward :oops: :)


Post Reply