From 6fab261114bcee166ac6fd7be2e6230c34d73d63 Mon Sep 17 00:00:00 2001 From: xtursky Date: Wed, 12 Jun 2019 15:37:19 +0200 Subject: [PATCH] fix(addons): do not cut end while dragging multiday event (#1342) --- src/addons/dragAndDrop/EventContainerWrapper.js | 2 +- src/utils/TimeSlots.js | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/addons/dragAndDrop/EventContainerWrapper.js b/src/addons/dragAndDrop/EventContainerWrapper.js index d92da7f50..ffa6eecca 100644 --- a/src/addons/dragAndDrop/EventContainerWrapper.js +++ b/src/addons/dragAndDrop/EventContainerWrapper.js @@ -94,7 +94,7 @@ class EventContainerWrapper extends React.Component { 'minutes' ) - this.update(event, slotMetrics.getRange(currentSlot, end)) + this.update(event, slotMetrics.getRange(currentSlot, end, false, true)) } handleResize(point, boundaryBox) { diff --git a/src/utils/TimeSlots.js b/src/utils/TimeSlots.js index e0118b554..06e399dc4 100644 --- a/src/utils/TimeSlots.js +++ b/src/utils/TimeSlots.js @@ -124,9 +124,11 @@ export function getSlotMetrics({ min: start, max: end, step, timeslots }) { return dates.gt(dates.merge(end, date), end, 'minutes') }, - getRange(rangeStart, rangeEnd) { - rangeStart = dates.min(end, dates.max(start, rangeStart)) - rangeEnd = dates.min(end, dates.max(start, rangeEnd)) + getRange(rangeStart, rangeEnd, ignoreMin, ignoreMax) { + if (!ignoreMin) + rangeStart = dates.min(end, dates.max(start, rangeStart)) + if (!ignoreMax) + rangeEnd = dates.min(end, dates.max(start, rangeEnd)) const rangeStartMin = positionFromDate(rangeStart) const rangeEndMin = positionFromDate(rangeEnd)