Bimba.git

ref: a18670b57039a2193fb8bd452fac6bf6c62051f8

app/src/main/java/ml/adamsprogs/bimba/extensions.kt


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
package ml.adamsprogs.bimba

import ml.adamsprogs.bimba.models.Timetable
import java.util.*

internal fun Calendar.getMode(): String {
    return when (this.get(Calendar.DAY_OF_WEEK)) {
        Calendar.SUNDAY -> Timetable.MODE_SUNDAYS
        Calendar.SATURDAY -> Timetable.MODE_SATURDAYS
        else -> Timetable.MODE_WORKDAYS
    }
}