include the currently running time entry in the calendar header

This commit is contained in:
Gregor Vostrak
2025-11-20 13:17:48 +01:00
parent 022caf59ee
commit bacd6f4222
2 changed files with 16 additions and 9 deletions

View File

@@ -177,14 +177,21 @@ const events = computed(() => {
// Daily totals used in day header // Daily totals used in day header
const dailyTotals = computed(() => { const dailyTotals = computed(() => {
const totals: Record<string, number> = {}; const totals: Record<string, number> = {};
props.timeEntries props.timeEntries.forEach((entry) => {
.filter((entry) => entry.end !== null)
.forEach((entry) => {
const date = getDayJsInstance()(entry.start).format('YYYY-MM-DD'); const date = getDayJsInstance()(entry.start).format('YYYY-MM-DD');
const duration = getDayJsInstance()(entry.end!).diff( let duration: number;
if (entry.end !== null) {
// Completed entry
duration = getDayJsInstance()(entry.end).diff(
getDayJsInstance()(entry.start), getDayJsInstance()(entry.start),
'minutes' 'minutes'
); );
} else {
// Running entry - use current time
duration = currentTime.value.diff(getDayJsInstance()(entry.start), 'minutes');
}
totals[date] = (totals[date] || 0) + duration; totals[date] = (totals[date] || 0) + duration;
}); });
return totals; return totals;

View File

@@ -183,7 +183,7 @@ body {
--popover: var(--theme-color-card-background); --popover: var(--theme-color-card-background);
--popover-foreground: var(--color-text-primary); --popover-foreground: var(--color-text-primary);
--primary: var(--color-bg-primary); --primary: var(--color-bg-primary);
--primary-foreground: var(--theme-color-button-primary-text); --primary-foreground: var(--color-text-primary);
--secondary: var(--color-bg-secondary); --secondary: var(--color-bg-secondary);
--secondary-foreground: var(--color-text-primary); --secondary-foreground: var(--color-text-primary);
--muted: var(--color-bg-tertiary); --muted: var(--color-bg-tertiary);
@@ -210,7 +210,7 @@ body {
--popover: var(--theme-color-card-background); --popover: var(--theme-color-card-background);
--popover-foreground: var(--color-text-primary); --popover-foreground: var(--color-text-primary);
--primary: var(--color-bg-primary); --primary: var(--color-bg-primary);
--primary-foreground: var(--theme-color-button-primary-text); --primary-foreground: var(--color-text-primary);
--secondary: var(--color-bg-secondary); --secondary: var(--color-bg-secondary);
--secondary-foreground: var(--color-text-primary); --secondary-foreground: var(--color-text-primary);
--muted: var(--color-bg-tertiary); --muted: var(--color-bg-tertiary);