Skip to content

Commit

Permalink
Merge pull request #1651 from zetkin/issue-1614/week-calender-draggin…
Browse files Browse the repository at this point in the history
…g-bug

If the endTime is >=24, then set endTime to 23:59
  • Loading branch information
ziggabyte authored Nov 22, 2023
2 parents b56d313 + 04ca709 commit 96c5f59
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/features/calendar/components/CalendarWeekView/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ const CalendarWeekView = ({ focusDate, onClickDay }: CalendarWeekViewProps) => {
sx={{
backgroundImage: `repeating-linear-gradient(180deg, ${theme.palette.grey[400]}, ${theme.palette.grey[400]} 1px, ${theme.palette.grey[200]} 1px, ${theme.palette.grey[200]} ${HOUR_HEIGHT}px)`,
marginTop: '0.6em', // Aligns the hour marker on each day to the hour on the hour column
overflow: 'hidden', // Will prevent the ghostElement to expand the size of the calender, showing vertical scrollbar and whitespace underneath calender #issue-#1614
}}
>
<EventDayLane
Expand All @@ -173,8 +174,8 @@ const CalendarWeekView = ({ focusDate, onClickDay }: CalendarWeekViewProps) => {
date.getFullYear(),
date.getMonth(),
date.getDate(),
endTime[0],
endTime[1]
endTime[0] >= 24 ? 23 : endTime[0],
endTime[0] >= 24 ? 59 : endTime[1]
)
);

Expand Down

0 comments on commit 96c5f59

Please sign in to comment.