From fd2524eacd51f523998734f869b3343441e55b93 Mon Sep 17 00:00:00 2001 From: Peter Stone Date: Mon, 26 Jan 2026 16:54:40 -1000 Subject: Add day of week to timeline section headings Section headings now show the day of week for better orientation: - "Today - Monday" - "Tomorrow - Tuesday" - "Wednesday, Jan 29+" (for later items) Co-Authored-By: Claude Opus 4.5 --- internal/handlers/timeline.go | 18 ++++++++++++++++-- web/templates/partials/timeline-tab.html | 6 +++--- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/internal/handlers/timeline.go b/internal/handlers/timeline.go index 9821452..37e688f 100644 --- a/internal/handlers/timeline.go +++ b/internal/handlers/timeline.go @@ -16,6 +16,11 @@ type TimelineData struct { LaterItems []models.TimelineItem Start time.Time Days int + + // Section labels with day of week + TodayLabel string // e.g., "Today - Monday" + TomorrowLabel string // e.g., "Tomorrow - Tuesday" + LaterLabel string // e.g., "Wednesday, Jan 29" } // HandleTimeline renders the timeline view @@ -52,10 +57,19 @@ func (h *Handler) HandleTimeline(w http.ResponseWriter, r *http.Request) { return } + // Compute section labels with day of week + now := config.Now() + today := config.Today() + tomorrow := today.AddDate(0, 0, 1) + dayAfterTomorrow := today.AddDate(0, 0, 2) + // Group items by day section data := TimelineData{ - Start: start, - Days: days, + Start: start, + Days: days, + TodayLabel: "Today - " + now.Format("Monday"), + TomorrowLabel: "Tomorrow - " + tomorrow.Format("Monday"), + LaterLabel: dayAfterTomorrow.Format("Monday, Jan 2") + "+", } for _, item := range items { switch item.DaySection { diff --git a/web/templates/partials/timeline-tab.html b/web/templates/partials/timeline-tab.html index aeaba40..5f32530 100644 --- a/web/templates/partials/timeline-tab.html +++ b/web/templates/partials/timeline-tab.html @@ -9,7 +9,7 @@ {{if .TodayItems}}

- 📅 Today + 📅 {{.TodayLabel}}

{{range .TodayItems}} @@ -23,7 +23,7 @@ {{if .TomorrowItems}}
- 🗓️ Tomorrow + 🗓️ {{.TomorrowLabel}} ({{len .TomorrowItems}} items) @@ -41,7 +41,7 @@ {{if .LaterItems}}
-
📆 Later + 📆 {{.LaterLabel}} ({{len .LaterItems}} items) -- cgit v1.2.3