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