feat: add groupEventsByDate helper for schedule date headers
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user