Skip to content

Commit

Permalink
fix(addons): do not cut end while dragging multiday event (jquense#1342)
Browse files Browse the repository at this point in the history
  • Loading branch information
xtursky authored and jquense committed Jun 12, 2019
1 parent caa863f commit 6fab261
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/addons/dragAndDrop/EventContainerWrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
8 changes: 5 additions & 3 deletions src/utils/TimeSlots.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 6fab261

Please sign in to comment.