File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
apps/calendar/src/hooks/timeGrid Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -48,8 +48,14 @@ function getMovingEventPosition({
4848 const startIndex = Math . max ( getCurrentIndexByTime ( nextStart , hourStart ) , 0 ) ;
4949 const endIndex = Math . min ( getCurrentIndexByTime ( nextEnd , hourStart ) , timeGridDataRows . length - 1 ) ;
5050
51- const isStartAtPrevDate = nextStart . getDate ( ) < currentDate . getDate ( ) ;
52- const isEndAtNextDate = nextEnd . getDate ( ) > currentDate . getDate ( ) ;
51+ const isStartAtPrevDate =
52+ nextStart . getFullYear ( ) < currentDate . getFullYear ( ) ||
53+ nextStart . getMonth ( ) < currentDate . getMonth ( ) ||
54+ nextStart . getDate ( ) < currentDate . getDate ( ) ;
55+ const isEndAtNextDate =
56+ nextEnd . getFullYear ( ) > currentDate . getFullYear ( ) ||
57+ nextEnd . getMonth ( ) > currentDate . getMonth ( ) ||
58+ nextEnd . getDate ( ) > currentDate . getDate ( ) ;
5359 const indexDiff = endIndex - ( isStartAtPrevDate ? 0 : startIndex ) ;
5460
5561 const top = isStartAtPrevDate ? 0 : timeGridDataRows [ startIndex ] . top ;
You can’t perform that action at this time.
0 commit comments