Premium support for our pure JavaScript UI components


Post by pzs »

Hi,

I'd like to report a bug. As far as I see it is present in the SchedulerPro, but it is working in the normal Scheduler.
Tested in 5.2.0-beta and 5.2.2.

Steps to reproduce:

Expected: start date is changed, end date is not changed
Actual: start and end date are changed

Please provide a workaround/quick fix for that... thanks!


Post by alex.l »

Hi pzs,

Since you provide same date for endDate, it won't be recognized as a change of a field value.
To make that you want you need to do it 2 steps:

let r = schedulerPro.eventStore.getAt(0); 
const endDate = new Date(r.endDate);
// after startDate change, duration will be kept, so endDate will be moved to another value
r.startDate = '2020-03-23 03:00:00';
// set desired endDate separately
r.endDate = endDate;

All the best,
Alex


Post by pzs »

Hi Alex,

I've just tested, it's working property (as I expect) in the Scheduler (in the normal version), but not in the SchedulerPro:

https://bryntum.com/examples/scheduler/basic/ (normal Scheduler, not the Pro)

let r = scheduler.eventStore.getAt(0);
r.set({ startDate: '2017-01-01 08:00:00', endDate: new Date(r.endDate) });  // working as expected

We just upgraded from Scheduler to SchedulerPro recently and I'd expect the same behavior.

Furthermore, since I'm setting the startDate and endDate together, with an explicit value, I'm expecting it will be set without any change.
(these Event record updates come from the backend via websocket)

Maybe I should write my first example with a string value instead of the Date copy and you can see, why I'm expecting to not change the endDate.

r.set({ startDate: '2020-03-23 03:00:00', endDate: '2020-03-23 11:00:00' });

Still expecting a bugfix.


Post by alex.l »

I understood the case. Here is a ticket https://github.com/bryntum/support/issues/5590
For a workaround please use the suggested solution.
It's also possible to set startDate using r.setStartDate(newStartDate, false) to keep endDate on the place (change duration together with startDate, as you want).

All the best,
Alex


Post by pzs »

Thanks!
Also I found my earlier bug ticket, same bug in v4 which was fixed once already in the normal Scheduler:
viewtopic.php?p=90551
https://github.com/bryntum/support/issues/3232


Post Reply