{{define "timeline-tab"}}
{{if .TodayItems}}

📅 {{.TodayLabel}}

{{range .TodayItems}} {{template "timeline-item" .}} {{end}}
{{end}} {{if .TomorrowItems}}
🗓️ {{.TomorrowLabel}} ({{len .TomorrowItems}} items)
{{range .TomorrowItems}} {{template "timeline-item" .}} {{end}}
{{end}} {{if .LaterItems}}
📆 {{.LaterLabel}} ({{len .LaterItems}} items)
{{range .LaterItems}} {{template "timeline-item" .}} {{end}}
{{end}} {{if and (not .TodayItems) (not .TomorrowItems) (not .LaterItems)}}

No items found for the selected range.

{{end}}
{{end}} {{define "timeline-item"}}
{{if or (eq .Type "task") (eq .Type "card") (eq .Type "gtask")}} {{end}} {{/* Only show time if it's not midnight (12:00 AM = all-day/no specific time) */}} {{if or (ne .Time.Hour 0) (ne .Time.Minute 0)}}
{{.Time.Format "3:04 PM"}} {{if .EndTime}} {{.EndTime.Format "3:04 PM"}} {{end}}
{{end}}

{{.Title}}

{{if .URL}} {{end}}
{{if .Description}}

{{.Description}}

{{end}} {{/* Only show type badge for non-task items, and done badge if completed */}} {{if or (ne .Type "task") .IsCompleted}}
{{if ne .Type "task"}} {{.Type}} {{end}} {{if .IsCompleted}} done {{end}}
{{end}}
{{end}}