diff --git a/frontend/tests/log.spec.ts b/frontend/tests/log.spec.ts index f0d8f7a..7692ed1 100644 --- a/frontend/tests/log.spec.ts +++ b/frontend/tests/log.spec.ts @@ -81,7 +81,7 @@ test("Cox can start and finish trip", async ({ page }, testInfo) => { const currentValue = await page.$eval(datetimeSelector, el => el.value); const currentDate = new Date(currentValue); currentDate.setMinutes(currentDate.getMinutes() + 1); - currentDate.setHours(currentDate.getHours() + 1); + currentDate.setHours(currentDate.getHours() - new Date().getTimezoneOffset()/60); const newDatetime = currentDate.toISOString().slice(0, 16); await page.$eval(datetimeSelector, (el, value) => el.value = value, newDatetime); @@ -165,7 +165,7 @@ test("Kiosk can start and finish trip", async ({ page }, testInfo) => { const currentValue = await page.$eval(datetimeSelector, el => el.value); const currentDate = new Date(currentValue); currentDate.setMinutes(currentDate.getMinutes() + 1); - currentDate.setHours(currentDate.getHours() + 1); + currentDate.setHours(currentDate.getHours() - new Date().getTimezoneOffset()/60); const newDatetime = currentDate.toISOString().slice(0, 16); await page.$eval(datetimeSelector, (el, value) => el.value = value, newDatetime); diff --git a/src/model/logbook.rs b/src/model/logbook.rs index 36fcd9c..98c7d13 100644 --- a/src/model/logbook.rs +++ b/src/model/logbook.rs @@ -505,7 +505,7 @@ ORDER BY departure DESC let dep = NaiveDateTime::parse_from_str(&log.departure, "%Y-%m-%dT%H:%M").unwrap(); let arr = NaiveDateTime::parse_from_str(&log.arrival, "%Y-%m-%dT%H:%M").unwrap(); - if arr.timestamp() <= dep.timestamp() { + if arr.timestamp() < dep.timestamp() { return Err(LogbookUpdateError::ArrivalNotAfterDeparture); } let today = Local::now().date_naive(); diff --git a/templates/includes/forms/log.html.tera b/templates/includes/forms/log.html.tera index 56c4ad0..67bb2a9 100644 --- a/templates/includes/forms/log.html.tera +++ b/templates/includes/forms/log.html.tera @@ -223,10 +223,10 @@ Ruderer: {% for rower in log.rowers -%} {{ rower.name }} - {% if rower.id == log.steering_user.id and rower.id != log.shipmaster_user.id %} + {%- if rower.id == log.steering_user.id and rower.id != log.shipmaster_user.id %} (Steuerperson){%- endif -%} {%- if not loop.last or amount_guests > 0 and log.boat.name != 'Externes Boot' %},{% endif %} - {% endfor %} + {% endfor -%} {% if amount_guests > 0 and log.boat.name != 'Externes Boot' %} Gäste (ohne Account):