add end time for job, delete empty jobtype

This commit is contained in:
Tim Gröger 2023-04-28 19:55:12 +02:00
parent e1ad8f0f11
commit 3ba7e5d366
2 changed files with 9 additions and 1 deletions

View File

@ -33,7 +33,7 @@
input-debounce="0" input-debounce="0"
class="col-xs-12 col-sm-6 q-pa-sm" class="col-xs-12 col-sm-6 q-pa-sm"
:options="jobtypes" :options="jobtypes"
option-label="name" :option-label="jobtype => typeof jobtype === 'number' ? '' : jobtype.name"
option-value="id" option-value="id"
map-options map-options
clearable clearable

View File

@ -30,6 +30,14 @@ export class Job implements FG.Job {
milliseconds: 0, milliseconds: 0,
}); });
else this.start = new Date(); // <-- make TS happy "no initalizer" 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); if (iJob !== undefined) Object.assign(this, iJob);
} }