Skip to content

Commit c1762d4

Browse files
committed
Fix view of auto schedule missions that cross midnight
1 parent 2436791 commit c1762d4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

frontend/src/pages/FrontPage/AutoScheduleSection/AutoScheduleCalendar.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,9 @@ export const CalendarPro = () => {
195195
const offset = (allDaysStartingSunday.indexOf(day) - today.getDay() + 7) % 7
196196
const targetDate = new Date(today)
197197
targetDate.setDate(today.getDate() + offset)
198-
const [hours, minutes] = time.split(':').map(Number)
198+
const hours = time.split(':').map(Number)[0]
199+
let minutes = time.split(':').map(Number)[1]
200+
if (hours === 23) minutes = 0 // To prevend wrapping over to next day
199201
targetDate.setHours(hours, minutes, 0, 0)
200202
return targetDate
201203
}

0 commit comments

Comments
 (0)