add daily duration to header, fix dropdown overflows, add time dropdown to duration select

This commit is contained in:
Gregor Vostrak
2024-08-23 15:34:49 +02:00
parent 33d139e3aa
commit 859833452f
7 changed files with 85 additions and 33 deletions

View File

@@ -112,11 +112,16 @@ function startTimeEntryFromExisting(entry: TimeEntry) {
description: entry.description,
});
}
function sumDuration(timeEntries: TimeEntry[]) {
return timeEntries.reduce((acc, entry) => acc + (entry?.duration ?? 0), 0);
}
</script>
<template>
<div v-for="(value, key) in groupedTimeEntries" :key="key">
<TimeEntryRowHeading :date="key"></TimeEntryRowHeading>
<TimeEntryRowHeading
:date="key"
:duration="sumDuration(value)"></TimeEntryRowHeading>
<template v-for="entry in value" :key="entry.id">
<TimeEntryAggregateRow
:createProject
@@ -127,6 +132,7 @@ function startTimeEntryFromExisting(entry: TimeEntry) {
:clients
:onStartStopClick="startTimeEntryFromExisting"
:updateTimeEntries
:updateTimeEntry
:deleteTimeEntries
:createTag
:currency="currency"
@@ -145,7 +151,7 @@ function startTimeEntryFromExisting(entry: TimeEntry) {
:deleteTimeEntry="() => deleteTimeEntries([entry])"
:currency="currency"
v-else
:time-entry="entry"></TimeEntryRow>
:time-entry="entry.timeEntries[0]"></TimeEntryRow>
</template>
</div>
</template>