Skip to content

Instantly share code, notes, and snippets.

@richard-gibson
Created June 25, 2020 16:43
Show Gist options
  • Save richard-gibson/7efc760d20fec25cfe09fd4d14db867b to your computer and use it in GitHub Desktop.
Save richard-gibson/7efc760d20fec25cfe09fd4d14db867b to your computer and use it in GitHub Desktop.
data class Location(val location: String, val since: String, val till: String)
val searchDate = LocalDate.now()
locations.filter { location ->
searchDate.isAfter(LocalDate.parse(location.since, DateTimeFormatter.ISO_DATE)) &&
searchDate.isBefore(LocalDate.parse(location.since, DateTimeFormatter.ISO_DATE))
}.groupBy { it.location }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment