Bimba.git

ref: 85f4ee806ced6e075630cfb0cb52cead4c4a0f25

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 {
    when (this.get(Calendar.DAY_OF_WEEK)) {
        Calendar.SUNDAY -> return Timetable.MODE_SUNDAYS
        Calendar.SATURDAY -> return Timetable.MODE_SATURDAYS
        else -> return Timetable.MODE_WORKDAYS
    }
}