24 lines
689 B
Kotlin
24 lines
689 B
Kotlin
package moe.kageru.spektacles
|
|
|
|
import java.time.Month
|
|
|
|
fun ParsedLines.filterUsers(vararg users: String): ParsedLines {
|
|
return this.filter { line -> line.user.exists { it in users } }
|
|
}
|
|
|
|
fun ParsedLines.filterModes(vararg modes: UserMode): ParsedLines {
|
|
return this.filter { line -> line.userMode in modes }
|
|
}
|
|
|
|
fun ParsedLines.filterYears(vararg years: Int): ParsedLines {
|
|
return this.filter { line -> line.time.year in years }
|
|
}
|
|
|
|
fun ParsedLines.filterMonths(vararg months: Month): ParsedLines {
|
|
return this.filter { line -> line.time.month in months }
|
|
}
|
|
|
|
fun ParsedLines.filterDays(vararg days: Int): ParsedLines {
|
|
return this.filter { line -> line.time.dayOfMonth in days }
|
|
}
|