Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
rudeh2926 committed Nov 5, 2024
2 parents cad886c + a90f9fe commit 85f0b8b
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class QueryIsWeekendMealPeriodService(
}

private fun findNextPeriod(today: LocalDate, periods: List<WeekendMealPeriod>): WeekendMealPeriod? {
return periods.filter { it.start.isAfter(today) }
.minByOrNull { it.start }
return periods.firstOrNull { it.start.isAfter(today) }
?: periods.lastOrNull { it.end.isBefore(today) }
}
}

0 comments on commit 85f0b8b

Please sign in to comment.