Skip to content

Commit

Permalink
Fix rendering of timeslots spanning two days (#493)
Browse files Browse the repository at this point in the history
closes #328
  • Loading branch information
mic4ael authored Oct 23, 2024
1 parent f0c6093 commit 1633f31
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion newdle/client/src/components/answer/Calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function calculateHeight(start, end, minHour, maxHour) {
endMins = end.hours() * 60 + end.minutes();
} else if (end.day() !== start.day()) {
// the end of the slot is on another day so we will allow the slot to overflow
endMins = maxHour * 60 + end.minutes();
endMins = MAX_HOUR * 60 + end.hour() * 60 + end.minutes();
}

if (startMins < minHour * 60) {
Expand Down
4 changes: 3 additions & 1 deletion newdle/client/src/util/date.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ export function getHourSpan(input) {
} else if (minTimelineHour < defaultMinHour) {
// shift
return [minTimelineHour, minTimelineHour + defaultHourSpan];
} else if (maxTimelineHour > defaultMaxHour) {
return [defaultMinHour, maxTimelineHour];
} else {
return [defaultMinHour, defaultMaxHour];
}
Expand All @@ -66,7 +68,7 @@ export function hourRange(start, end, step = 1, extendToNextDay = true) {
if (extendToNextDay) {
hours.push(it - 24);
}
break;
continue;
}

hours.push(it);
Expand Down

0 comments on commit 1633f31

Please sign in to comment.