show steering person in logs if not cox #376

Merged
philipp merged 3 commits from show-steering-person-in-logs into main 2024-04-15 22:04:16 +02:00
3 changed files with 5 additions and 5 deletions
Showing only changes of commit 8315a27ea8 - Show all commits

View File

@ -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);

View File

@ -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();

View File

@ -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
<small class="text-gray-600 dark:text-gray-100">(ohne Account)</small>: