summaryrefslogtreecommitdiff
path: root/internal/handlers/timeline_logic.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/handlers/timeline_logic.go')
-rw-r--r--internal/handlers/timeline_logic.go17
1 files changed, 13 insertions, 4 deletions
diff --git a/internal/handlers/timeline_logic.go b/internal/handlers/timeline_logic.go
index 5ea44b5..7a85393 100644
--- a/internal/handlers/timeline_logic.go
+++ b/internal/handlers/timeline_logic.go
@@ -2,6 +2,7 @@ package handlers
import (
"context"
+ "log"
"sort"
"strings"
"time"
@@ -130,7 +131,9 @@ func BuildTimeline(ctx context.Context, s *store.Store, calendarClient api.Googl
// 4. Fetch Events
if calendarClient != nil {
events, err := calendarClient.GetEventsByDateRange(ctx, start, end)
- if err == nil {
+ if err != nil {
+ log.Printf("Warning: failed to fetch calendar events: %v", err)
+ } else {
for _, event := range events {
endTime := event.End
item := models.TimelineItem{
@@ -142,7 +145,7 @@ func BuildTimeline(ctx context.Context, s *store.Store, calendarClient api.Googl
Description: event.Description,
URL: event.HTMLLink,
OriginalItem: event,
- IsCompleted: false, // Events don't have completion status
+ IsCompleted: false,
Source: "calendar",
}
item.ComputeDaySection(now)
@@ -154,9 +157,13 @@ func BuildTimeline(ctx context.Context, s *store.Store, calendarClient api.Googl
// 5. Fetch Google Tasks
if tasksClient != nil {
gTasks, err := tasksClient.GetTasksByDateRange(ctx, start, end)
- if err == nil {
+ if err != nil {
+ log.Printf("Warning: failed to fetch Google Tasks: %v", err)
+ } else {
+ log.Printf("Google Tasks: fetched %d tasks in date range", len(gTasks))
for _, gTask := range gTasks {
- taskTime := start // Default to start of range if no due date
+ // Tasks without due date are placed in today section
+ taskTime := now
if gTask.DueDate != nil {
taskTime = *gTask.DueDate
}
@@ -176,6 +183,8 @@ func BuildTimeline(ctx context.Context, s *store.Store, calendarClient api.Googl
items = append(items, item)
}
}
+ } else {
+ log.Printf("Google Tasks client not configured")
}
// Sort items by Time