Hi,
I show in the scheduler two type of events. The first type can only be daily and the second one could be both, daily and semi-daily.
I have to respect this fact when moving or resizing the events. The solution would be to deactivate the snap to grid feature and implement the behaviour manually in onEventMoving and onEventResizing. However, I'm struggling with it. I tried something like this for onEventResizing. However, it doesn't work always very smoothly.
onEventResizing: (args) => {
if (event.tags.type == 'AdditionalService' || event.tags.type == 'Service' || event.tags.type == 'PlanningBreak') {
if (args.what == 'start') {
let newStart = new Date(args.start);
if (newStart.getHours() == 12) {
args.start = newStart.subHours(12);
}
}
if (args.what == 'end') {
let newEnd = new Date(args.end);
if (newEnd.getHours() == 12) {
args.end = newEnd.addHours(12);
}
}
}
},
I also have to restore the default behaviour in onTimeRangeSelecting according to the current value of the scale property, because I'm deactivating the snap to grid feature.
Could you please provide me with an accurateimplmention for the three events, because I'm not able to achieve it.
Thank you very much in advance!