(admin) avoid empty strings in timesheets

This commit is contained in:
Andrea Vos 2025-06-29 12:33:46 +02:00
parent efcd383c1a
commit 746ec76a3f
2 changed files with 5 additions and 4 deletions

View File

@ -153,7 +153,7 @@ const sumCells = (area: typeof areas[number] | undefined, month: keyof typeof mo
<template>
<Page wide>
<NotFound v-if="!$isGranted('panel') && !$isGranted('external')" />
<div v-else>
<form @submit="save" v-else>
<p class="d-flex justify-content-between">
<nuxt-link to="/admin">
<Icon v="user-cog" />
@ -212,6 +212,7 @@ const sumCells = (area: typeof areas[number] | undefined, month: keyof typeof mo
class="form-control form-control-sm"
style="min-width: 3rem"
:disabled="dt(year, +m) < closed || dt(year, +m) > max"
required
@focus="focusMonth = m;focusArea = areas.indexOf(area)"
@keydown="cellKeydown"
>
@ -289,10 +290,10 @@ const sumCells = (area: typeof areas[number] | undefined, month: keyof typeof mo
<input id="notes" v-model="transferDetails.notes" type="text" class="form-control" placeholder="">
</div>
</section>
<button type="button" class="btn btn-primary" :disabled="!transferMethod" @click="save">
<button type="submit" class="btn btn-primary" :disabled="!transferMethod">
<Icon v="save" />
Save
</button>
</div>
</form>
</Page>
</template>

View File

@ -46,7 +46,7 @@ const hoursSummary = computed((): Record<string, number> => {
continue;
}
for (const h of Object.values(timesheet[parseInt(year)][month])) {
hours += h;
hours += parseInt(h as any);
}
}
}