diff --git a/newdle/client/src/components/answer/Calendar.js b/newdle/client/src/components/answer/Calendar.js index d2654fe2..ca9024c5 100644 --- a/newdle/client/src/components/answer/Calendar.js +++ b/newdle/client/src/components/answer/Calendar.js @@ -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) { diff --git a/newdle/client/src/util/date.js b/newdle/client/src/util/date.js index fb0173ff..a671ee21 100644 --- a/newdle/client/src/util/date.js +++ b/newdle/client/src/util/date.js @@ -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]; } @@ -66,7 +68,7 @@ export function hourRange(start, end, step = 1, extendToNextDay = true) { if (extendToNextDay) { hours.push(it - 24); } - break; + continue; } hours.push(it);