@@ -2,7 +2,6 @@ package com.cornellappdev.transit.ui.viewmodels
22
33import android.content.Context
44import androidx.compose.ui.text.AnnotatedString
5- import androidx.compose.ui.text.PlatformTextStyle
65import androidx.compose.ui.text.SpanStyle
76import androidx.compose.ui.text.buildAnnotatedString
87import androidx.compose.ui.text.font.FontWeight
@@ -356,7 +355,7 @@ class HomeViewModel @Inject constructor(
356355 }
357356
358357 /* *
359- * Given operating hours rotated for today's date , return whether it is open and when it is open until
358+ * Given operating hours, return whether it is open and when it is open until
360359 * or when it will next open
361360 *
362361 * @param operatingHours A list of pairs mapping the first value day string to second value list of hours open
@@ -365,13 +364,14 @@ class HomeViewModel @Inject constructor(
365364 operatingHours : List <DayOperatingHours >,
366365 currentDateTime : LocalDateTime = LocalDateTime .now()
367366 ): OpenStatus {
367+ val rotatedOperatingHours = rotateOperatingHours(operatingHours)
368368
369369 val currentTime = currentDateTime.toLocalTime()
370- val todaySchedule = operatingHours [0 ].hours // First day should be today after rotation
370+ val todaySchedule = rotatedOperatingHours [0 ].hours // First day should be today after rotation
371371
372372 // Check if closed today
373373 if (todaySchedule.any { it.equals(" Closed" , ignoreCase = true ) }) {
374- return findOpenNextDay(operatingHours )
374+ return findOpenNextDay(rotatedOperatingHours )
375375 }
376376
377377 val timeRanges = todaySchedule.mapNotNull { parseTimeRange(it) }
@@ -391,7 +391,7 @@ class HomeViewModel @Inject constructor(
391391 }
392392
393393 // Closed for today, find next open day
394- return findOpenNextDay(operatingHours )
394+ return findOpenNextDay(rotatedOperatingHours )
395395 }
396396
397397 /* *
0 commit comments