Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
eddiekimdev committed Mar 9, 2020
1 parent 99e20bc commit 768c3e6
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 17 deletions.
43 changes: 30 additions & 13 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/addons/dragAndDrop/EventContainerWrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,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
9 changes: 6 additions & 3 deletions src/utils/TimeSlots.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,12 @@ 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) {
// rangeStart = dates.min(end, dates.max(start, rangeStart))
// rangeEnd = dates.min(end, dates.max(start, rangeEnd))

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 768c3e6

Please sign in to comment.