Unlock sunday in navigation datepicker (#1506)

This commit is contained in:
Mikołaj Pich 2021-09-13 14:19:46 +02:00 committed by GitHub
parent 5a7f52c773
commit 19c96ee83f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,7 +2,6 @@ package io.github.wulkanowy.utils
import com.google.android.material.datepicker.CalendarConstraints import com.google.android.material.datepicker.CalendarConstraints
import kotlinx.parcelize.Parcelize import kotlinx.parcelize.Parcelize
import java.time.DayOfWeek
import java.time.temporal.ChronoUnit import java.time.temporal.ChronoUnit
@Parcelize @Parcelize
@ -12,7 +11,6 @@ class SchoolDaysValidator(val start: Long, val end: Long) : CalendarConstraints.
val date = dateLong.toLocalDateTime() val date = dateLong.toLocalDateTime()
return date.until(end.toLocalDateTime(), ChronoUnit.DAYS) >= 0 && return date.until(end.toLocalDateTime(), ChronoUnit.DAYS) >= 0 &&
date.until(start.toLocalDateTime(), ChronoUnit.DAYS) <= 0 && date.until(start.toLocalDateTime(), ChronoUnit.DAYS) <= 0
date.dayOfWeek != DayOfWeek.SUNDAY
} }
} }