mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-18 13:12:16 +01:00
include the currently running time entry in the calendar header
This commit is contained in:
@@ -177,16 +177,23 @@ 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)
|
const date = getDayJsInstance()(entry.start).format('YYYY-MM-DD');
|
||||||
.forEach((entry) => {
|
let duration: number;
|
||||||
const date = getDayJsInstance()(entry.start).format('YYYY-MM-DD');
|
|
||||||
const duration = getDayJsInstance()(entry.end!).diff(
|
if (entry.end !== null) {
|
||||||
|
// Completed entry
|
||||||
|
duration = getDayJsInstance()(entry.end).diff(
|
||||||
getDayJsInstance()(entry.start),
|
getDayJsInstance()(entry.start),
|
||||||
'minutes'
|
'minutes'
|
||||||
);
|
);
|
||||||
totals[date] = (totals[date] || 0) + duration;
|
} else {
|
||||||
});
|
// Running entry - use current time
|
||||||
|
duration = currentTime.value.diff(getDayJsInstance()(entry.start), 'minutes');
|
||||||
|
}
|
||||||
|
|
||||||
|
totals[date] = (totals[date] || 0) + duration;
|
||||||
|
});
|
||||||
return totals;
|
return totals;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user