Assuming that 1. Event has startDate = 3/12/22, endDate = 3/13/22, we have that the duration of the event is 1 day.
If we change only the start date, the duration remains as 1 day, so that's why the end date is updated to 3/12/22.
If you want that the end date remains at 3/13/22, you'll need to update the duration of the event to 2 days, as it's the timespan between 3/11/22 and 3/13/22.
I hear that. The point is that I don't provide the duration field in the inline data. If I understand it correctly, the duration is therefore calculated automatically from startDate and endDate. After I provide the new startDate, the duration should consequently automatically be updated to 2 days here.
Hey, actually the duration is calculated with the start/end dates provided on the first load. After that, you need to update the duration also to work as you mentioned.
That's a bummer because taking care of the duration myself would be very inconvenient in my setup. The weird thing is that in the test case I provided, the duration will be automatically updated correctly when the change button is clicked twice (and there is no difference in the input - basically just repeating step 2 will produce a correct duration). Can you maybe check why the duration is calculated for the second change (with exact same dates) correctly, but not for the first change?
Hello,
There is a difference in Scheduler Pro when you provide an event startDate and endDate only.
When you provide endDate only its treated as the event resize, but when you provide startDate only it's treated as the event move operation.
Worth mentioning that calling setStartDate will also trigger the change propagation
If you want to avoid that you can use putStartDate instead (it is not documented but that's just an issue in the docs it exists since the very beginning of the engine).
thanks for the reply. It is still not very convenient to use an additional set*method on the event here, because I am just using the inline events array. I am obviously not into your code. But I still have the feeling that this is something that could be changed for the inline data. The point of inline events is that I can use them as a single source of truth (at least this is what I expected), such that they always match the displayed events. But here, the scheduler produces a result, that is different from the events array, so I can't rely on the inline data anymore. Would it be possible to change the logic? The point is when changing startDate + endDate together, the duration is updated correctly. It feels strange, that the endDate will be overwritten with an old duration even though the correct endDate is provided in the inline data.
I don't think that's possible to easily change this. This is expected behaviour: when startDate changed, event will be moved to new startDate but will keep duration. endDate change will keep startDate but update duration of the event.
To update startDate and duration together (in other words keep initial endDate), you can set startDate and endDate with 2 operations.