Skip to content

Commit

Permalink
fix: wrong event positioning when using portion of hours #353
Browse files Browse the repository at this point in the history
  • Loading branch information
slash-84 committed Apr 21, 2024
1 parent 61641a8 commit c029b03
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lib/components/events/TodayEvents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ const TodayEvents = ({

{todayEvents.map((event, i) => {
const height = differenceInMinutes(event.end, event.start) * minuteHeight - BORDER_HEIGHT;
const minituesFromTop = Math.abs(startHour - event.start.getHours()) * 60;
const minituesFromTop = Math.abs(
startHour * 60 - event.start.getHours() * 60 - event.start.getMinutes()
);
const topSpace = minituesFromTop * minuteHeight;
/** Add border factor to height of each slot */
const slots = height / 60;
Expand Down

0 comments on commit c029b03

Please sign in to comment.