@@ -79,13 +79,34 @@ class EventContainerWrapper extends React.Component {
7979 const newTime = slotMetrics . closestSlotFromPoint ( point , bounds )
8080
8181 let { start, end } = eventTimes ( event , accessors , localizer )
82+ let newRange
8283 if ( direction === 'UP' ) {
83- start = localizer . min ( newTime , slotMetrics . closestSlotFromDate ( end , - 1 ) )
84+ const newStart = localizer . min (
85+ newTime ,
86+ slotMetrics . closestSlotFromDate ( end , - 1 )
87+ )
88+ // Get the new range based on the new start
89+ // but don't overwrite the end date as it could be outside this day boundary.
90+ newRange = slotMetrics . getRange ( newStart , end )
91+ newRange = {
92+ ...newRange ,
93+ endDate : end ,
94+ }
8495 } else if ( direction === 'DOWN' ) {
85- end = localizer . max ( newTime , slotMetrics . closestSlotFromDate ( start ) )
96+ // Get the new range based on the new end
97+ // but don't overwrite the start date as it could be outside this day boundary.
98+ const newEnd = localizer . max (
99+ newTime ,
100+ slotMetrics . closestSlotFromDate ( start )
101+ )
102+ newRange = slotMetrics . getRange ( start , newEnd )
103+ newRange = {
104+ ...newRange ,
105+ startDate : start ,
106+ }
86107 }
87108
88- this . update ( event , slotMetrics . getRange ( start , end ) )
109+ this . update ( event , newRange )
89110 }
90111
91112 handleDropFromOutside = ( point , boundaryBox ) => {
0 commit comments