react-scheduler
react-scheduler copied to clipboard
Resize event
This adds a drag handle to the bottom of an event in day and week view so that the length of the event can be easily changed.
https://github.com/user-attachments/assets/cb855c29-b09b-4117-aa98-0389fd70efad
This depends on my PR #416 as I wanted the updated packages before I started doing my changes.
I plan to implement more accurate dragging next for setting event start times - the idea would be drag the event to the correct start time, then resize it to the correct finish time. This would make it in line with many other calendar apps.
I'm also considering whether I want to offer a 'dragSnap' scheduler option that would snap resizing and dragging of events to, for example, the nearest 5 minutes. This would mean we could keep the 'step' option that we current have for the actual drawing of the calendar, but also snap event drag and resize to a different unit.
Amazing @vespasianvs! I assume this would be applicable on week/day views only? month view might have some limitation? (horizontal/vertical sizing, plus days instead of time). Having it on week/day only as starting point is an amazing addition
Yeah - it's just week/day views only and doesn't work for multiday events as it's for resizing the hours. A similar strategy should work in those cases, but I've not done it as I'm afraid it's not something I need right now for the project that I'm working on.
Changed from react-router-dom to react-router: https://www.npmjs.com/package/react-router-dom
I'm also considering whether I want to offer a 'dragSnap' scheduler option that would snap resizing and dragging of events to, for example, the nearest 5 minutes. This would mean we could keep the 'step' option that we current have for the actual drawing of the calendar, but also snap event drag and resize to a different unit.
if we can set the snap rule using a custom function that would be great. so we can snap if minute%5/%10/%15/%30, or some crazy rule like during sunday, if hour=12pm/6pm, minute snap can only be 32. return false for other value of minute