From 3ba7e5d3665f071365825731d1f04abca5e77422 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Gr=C3=B6ger?= Date: Fri, 28 Apr 2023 19:55:12 +0200 Subject: [PATCH] add end time for job, delete empty jobtype --- src/components/management/EditJobSlot.vue | 2 +- src/store/models.ts | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/components/management/EditJobSlot.vue b/src/components/management/EditJobSlot.vue index 1c83610..deb2dac 100644 --- a/src/components/management/EditJobSlot.vue +++ b/src/components/management/EditJobSlot.vue @@ -33,7 +33,7 @@ input-debounce="0" class="col-xs-12 col-sm-6 q-pa-sm" :options="jobtypes" - option-label="name" + :option-label="jobtype => typeof jobtype === 'number' ? '' : jobtype.name" option-value="id" map-options clearable diff --git a/src/store/models.ts b/src/store/models.ts index fed3e19..2644891 100644 --- a/src/store/models.ts +++ b/src/store/models.ts @@ -30,6 +30,14 @@ export class Job implements FG.Job { milliseconds: 0, }); else this.start = new Date(); // <-- make TS happy "no initalizer" + if (!iJob || iJob.end === undefined) { + this.end = date.buildDate({ + hours: new Date().getHours() + 4, + minutes: 0, + seconds: 0, + milliseconds: 0, + }); + } if (iJob !== undefined) Object.assign(this, iJob); }