Add duration_minutes field to schedule blocks

Separates "recommended time" (time_start/time_end) from actual timer
duration. If duration_minutes is set, the timer counts down from that
value; otherwise falls back to the time_start–time_end window.

- ScheduleBlock model: add nullable duration_minutes INT column
- Startup migration: idempotent ADD COLUMN for existing DBs
- Schemas: duration_minutes in create, update, and out
- TimerDisplay: prefer duration_minutes * 60 over time diff when set
- Admin block forms: Duration (min) input on add and edit forms

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-28 10:23:30 -08:00
parent a019e2dda5
commit 1939b2cc45
5 changed files with 21 additions and 2 deletions

View File

@@ -45,6 +45,7 @@ function parseTime(str) {
const blockDuration = computed(() => {
if (!props.block) return 0
if (props.block.duration_minutes != null) return props.block.duration_minutes * 60
return parseTime(props.block.time_end) - parseTime(props.block.time_start)
})