From 23aaea462d6f9ced2774fcf7738ec2c587098a71 Mon Sep 17 00:00:00 2001 From: derekc Date: Sat, 28 Feb 2026 10:27:39 -0800 Subject: [PATCH] Show duration on schedule block lists MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Display effective duration (time window or custom override) on every block list — Admin, Dashboard, and TV sidebar. Custom duration_minutes values are highlighted in indigo to distinguish them from the default time-window calculation. Co-Authored-By: Claude Sonnet 4.6 --- frontend/src/components/ScheduleBlock.vue | 23 ++++++++++++++++++++++- frontend/src/views/AdminView.vue | 16 ++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/ScheduleBlock.vue b/frontend/src/components/ScheduleBlock.vue index 7c687fb..da5006f 100644 --- a/frontend/src/components/ScheduleBlock.vue +++ b/frontend/src/components/ScheduleBlock.vue @@ -12,7 +12,12 @@
{{ block.label || subjectName || 'Block' }}
-
{{ block.time_start }} – {{ block.time_end }}
+
+ {{ block.time_start }} – {{ block.time_end }} + + · {{ durationLabel }} + +
@@ -31,6 +36,19 @@ const props = defineProps({ const subjectColor = computed(() => props.block.subject?.color || '#475569') const subjectName = computed(() => props.block.subject?.name || null) + +const durationLabel = computed(() => { + if (props.block.duration_minutes != null) return `${props.block.duration_minutes} min` + const start = props.block.time_start + const end = props.block.time_end + if (start && end) { + const [sh, sm] = start.split(':').map(Number) + const [eh, em] = end.split(':').map(Number) + const mins = (eh * 60 + em) - (sh * 60 + sm) + if (mins > 0) return `${mins} min` + } + return '' +})