diff options
Diffstat (limited to 'internal/handlers/timeline.go')
| -rw-r--r-- | internal/handlers/timeline.go | 18 |
1 files changed, 16 insertions, 2 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 { |
