forked from github/wulkanowy-mirror
Unlock sunday in navigation datepicker (#1506)
This commit is contained in:
parent
5a7f52c773
commit
19c96ee83f
@ -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
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user