From bf9faee5f44961307587b4a2ec12d43362f22564 Mon Sep 17 00:00:00 2001 From: Matthieu Date: Fri, 13 Mar 2026 11:06:09 +0100 Subject: [PATCH] feat(frontend) : add current time indicator line on calendar Co-Authored-By: Claude Opus 4.6 --- .../time-tracking/TimeTrackingCalendar.vue | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/frontend/components/time-tracking/TimeTrackingCalendar.vue b/frontend/components/time-tracking/TimeTrackingCalendar.vue index 7961d9e..2e77fc0 100644 --- a/frontend/components/time-tracking/TimeTrackingCalendar.vue +++ b/frontend/components/time-tracking/TimeTrackingCalendar.vue @@ -108,6 +108,18 @@ + +
+
+
+
+
+
+
(null) const dayColumnEls = ref([]) const stickyOffset = computed(() => props.stickyOffset ?? 0) +// --- Current time indicator --- +const nowMinutes = ref(0) +let nowTimer: ReturnType | undefined + +function updateNowMinutes() { + const now = new Date() + nowMinutes.value = now.getHours() * 60 + now.getMinutes() +} + +const currentTimeTopPx = computed(() => (nowMinutes.value / 60) * hourHeight) + +updateNowMinutes() + +onMounted(() => { + nowTimer = setInterval(updateNowMinutes, 60_000) +}) + +onUnmounted(() => { + clearInterval(nowTimer) +}) + function getScrollParent(): HTMLElement | null { let el = calendarEl.value?.parentElement while (el) {