Fix room constraint
This commit is contained in:
parent
07a619f826
commit
5a9fa08e69
|
@ -251,7 +251,7 @@ fun Route.room() {
|
|||
+"Gesperrt"
|
||||
}
|
||||
input(
|
||||
name = "constraint-blocked-day-$index",
|
||||
name = "constraint-room-day-$index",
|
||||
classes = "form-control"
|
||||
) {
|
||||
value = constraint.day.toString()
|
||||
|
@ -259,7 +259,7 @@ fun Route.room() {
|
|||
placeholder = "Tag"
|
||||
}
|
||||
input(
|
||||
name = "constraint-blocked-start-$index",
|
||||
name = "constraint-room-start-$index",
|
||||
classes = "form-control"
|
||||
) {
|
||||
val time = constraint.start
|
||||
|
@ -277,7 +277,7 @@ fun Route.room() {
|
|||
placeholder = "Start"
|
||||
}
|
||||
input(
|
||||
name = "constraint-blocked-end-$index",
|
||||
name = "constraint-room-end-$index",
|
||||
classes = "form-control"
|
||||
) {
|
||||
val time = constraint.end
|
||||
|
@ -553,7 +553,7 @@ private fun parseConstraintParam(params: Map<String, String?>): List<RoomBlock>
|
|||
val h = v.substringBefore(":").toIntOrNull()
|
||||
val m = v.substringAfter(":").toIntOrNull()
|
||||
|
||||
val time = if (h != null && m != null) {
|
||||
val time = if (":" in v && h != null && m != null) {
|
||||
h * 60 + m
|
||||
} else {
|
||||
v.toIntOrNull()
|
||||
|
@ -565,7 +565,7 @@ private fun parseConstraintParam(params: Map<String, String?>): List<RoomBlock>
|
|||
val h = v.substringBefore(":").toIntOrNull()
|
||||
val m = v.substringAfter(":").toIntOrNull()
|
||||
|
||||
val time = if (h != null && m != null) {
|
||||
val time = if (":" in v && h != null && m != null) {
|
||||
h * 60 + m
|
||||
} else {
|
||||
v.toIntOrNull()
|
||||
|
|
Loading…
Reference in a new issue