Today — {today}
-
- {#if error}
-
{error}
- {/if}
-
- {#if closedDay}
-
- Day closed ({closedDay.kind}) — {formatDurationShort(closedDay.worked_ms)} worked
-
-
- {:else}
-
-
- {#if running}
-
{formatDuration(elapsed)}
-
- {:else}
-
{formatDuration(totalWorkedMs)}
-
- e.key === 'Enter' && handleStart()} />
-
-
- {/if}
-
-
-
-
- Mark day as:
-
-
-
-
-
-
- {#if entryList.length > 0 && !running}
-
- {/if}
- {/if}
-
-
-
-
-
-
- {#if showAddForm}
-
- {/if}
-
- {#if entryList.length === 0}
- No entries yet today.
- {:else}
- {#each entryList as entry (entry.id)}
- {#if editingId === entry.id}
-
-
- {:else}
-
- {formatTime(entry.start_time)}
- →
- {entry.end_time ? formatTime(entry.end_time) : '…'}
- {#if entry.end_time}
- {formatDuration(entry.end_time - entry.start_time)}
- {/if}
- {#if entry.note}
- {entry.note}
- {/if}
- {#if entry.auto_stopped}
- auto-stopped
- {/if}
- {#if !closedDay}
-
-
- {/if}
-
- {/if}
- {/each}
- Total: {formatDurationShort(totalWorkedMs)}
- {/if}
-
+
diff --git a/web/src/routes/week/+page.svelte b/web/src/routes/week/+page.svelte
index fe01c12..ac0d157 100644
--- a/web/src/routes/week/+page.svelte
+++ b/web/src/routes/week/+page.svelte
@@ -5,6 +5,8 @@
currentWeekKey, weekDayKeys, formatDurationShort, formatDelta, todayKey, isWorkday
} from '$lib/utils';
import DayChip from '$lib/components/DayChip.svelte';
+ import DayDetail from '$lib/components/DayDetail.svelte';
+ import { dayCapabilities } from '$lib/utils';
let weekKey = $state(currentWeekKey());
let dayKeys = $derived(weekDayKeys(weekKey));
@@ -102,6 +104,15 @@
function prevWeek() { weekKey = offsetWeek(weekKey, -1); }
function nextWeek() { weekKey = offsetWeek(weekKey, 1); }
+
+ // Today in this week?
+ const todayInWeek = $derived(dayKeys.includes(todayKey()));
+ const detailDayKey = $derived(todayInWeek ? todayKey() : null);
+ const detailCaps = $derived(
+ detailDayKey
+ ? dayCapabilities(detailDayKey, todayKey(), !!closedDaysMap[detailDayKey])
+ : null
+ );
function offsetWeek(wk: string, offset: number): string {
const [y, w] = wk.split('-W').map(Number);
const date = new Date(y, 0, 4);
@@ -163,6 +174,13 @@
{:else if canCloseWeek}