feat: add groupEventsByDate helper for schedule date headers

This commit is contained in:
2026-08-06 17:03:24 +02:00
parent b7af237002
commit cf24f9c0e3
2 changed files with 52 additions and 1 deletions
@@ -52,3 +52,9 @@ fun List<Event>.distinctAgegroups(): List<String> =
fun List<Event>.distinctSubgroups(): List<String> =
map { extractSubgroup(it.name) }.toSet().sorted()
fun groupEventsByDate(events: List<Event>): List<Pair<String, List<Event>>> =
events
.sortedBy { it.start }
.groupBy { it.start.take(10) }
.toList()