From d0f207704a406d4fbc65e89ef37f19bacfa0deef Mon Sep 17 00:00:00 2001 From: Peter Stone Date: Mon, 13 Jul 2026 18:10:10 +0000 Subject: feat(web): show multi-day calendar events on every day they span TimelineItemView wraps a TimelineItem with a per-render-day MultiDayVariant (starts/ends/spans/none). HandleTimeline's bucketing now places a multi-day event into both TodayItems and TomorrowItems when it touches both, instead of only the list matching its start day. --- internal/handlers/handlers.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'internal/handlers/handlers.go') diff --git a/internal/handlers/handlers.go b/internal/handlers/handlers.go index 408006d..e427e40 100644 --- a/internal/handlers/handlers.go +++ b/internal/handlers/handlers.go @@ -46,6 +46,26 @@ func New(s *store.Store, trello api.TrelloAPI, planToEat api.PlanToEatAPI, googl // Template functions funcMap := template.FuncMap{ "subtract": func(a, b int) int { return a - b }, + // multiDayLabel returns the "(starts/ends HH:MM)" suffix for a + // multi-day calendar event's row on the day it's rendered, or "" + // for a normal item or a "spans" (pass-through) day, which shows + // as a plain all-day row with no time label. + "multiDayLabel": func(item TimelineItemView) string { + switch item.MultiDayVariant { + case "starts": + if item.Time.Hour() == 0 && item.Time.Minute() == 0 { + return "" + } + return " (starts " + item.Time.Format("3:04 PM") + ")" + case "ends": + if item.EndTime == nil || (item.EndTime.Hour() == 0 && item.EndTime.Minute() == 0) { + return "" + } + return " (ends " + item.EndTime.Format("3:04 PM") + ")" + default: + return "" + } + }, } // Parse templates including partials -- cgit v1.2.3