Improves all-day event drag and drop

Addresses issues with all-day event duration calculation and positioning during drag and drop.

- Uses `differenceInCalendarDays` to correctly calculate event duration across timezone and DST boundaries.
- Preserves the original event time when moving events to a different day.
- Snaps dragged event to the top of the target time slot.
This commit is contained in:
Janus C. H. Knudsen 2025-10-03 19:09:44 +02:00
parent 53cf097a47
commit 4fea01c76b
3 changed files with 26 additions and 5 deletions

View file

@ -239,8 +239,9 @@ export class DateEventRenderer implements EventRendererStrategy {
public handleDragMove(payload: DragMoveEventPayload): void {
if (!this.draggedClone) return;
// Update position
this.draggedClone.style.top = (payload.snappedY - payload.mouseOffset.y) + 'px';
// Update position - snappedY is already the event top position
// Add +1px to match the initial positioning offset from SwpEventElement
this.draggedClone.style.top = (payload.snappedY + 1) + 'px';
// Update timestamp display
this.updateCloneTimestamp(payload);