From 42a4e32daca13b518e64e5821080ff3d6adf0e39 Mon Sep 17 00:00:00 2001 From: Peter Stone Date: Mon, 26 Jan 2026 16:49:44 -1000 Subject: Use configured timezone throughout codebase - Add config/timezone.go with timezone utilities: - SetDisplayTimezone(), GetDisplayTimezone() - Now(), Today() - current time/date in display TZ - ParseDateInDisplayTZ(), ToDisplayTZ() - parsing helpers - Initialize timezone at startup in main.go - Update all datetime logic to use configured timezone: - handlers/handlers.go - all time.Now() calls - handlers/timeline.go - date parsing - handlers/timeline_logic.go - now calculation - models/atom.go - ComputeUIFields() - models/timeline.go - ComputeDaySection() - api/plantoeat.go - meal date parsing - api/todoist.go - due date parsing - api/trello.go - due date parsing This ensures all dates/times display correctly regardless of server timezone setting. Co-Authored-By: Claude Opus 4.5 --- internal/api/trello.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'internal/api/trello.go') diff --git a/internal/api/trello.go b/internal/api/trello.go index a276726..1a5642c 100644 --- a/internal/api/trello.go +++ b/internal/api/trello.go @@ -125,7 +125,8 @@ func (c *TrelloClient) GetCards(ctx context.Context, boardID string) ([]models.C if apiCard.Due != nil && *apiCard.Due != "" { if dueDate, err := time.Parse(time.RFC3339, *apiCard.Due); err == nil { - card.DueDate = &dueDate + dueInTZ := config.ToDisplayTZ(dueDate) + card.DueDate = &dueInTZ } } @@ -267,7 +268,8 @@ func (c *TrelloClient) CreateCard(ctx context.Context, listID, name, description if apiCard.Due != nil && *apiCard.Due != "" { if parsedDate, err := time.Parse(time.RFC3339, *apiCard.Due); err == nil { - card.DueDate = &parsedDate + dueInTZ := config.ToDisplayTZ(parsedDate) + card.DueDate = &dueInTZ } } -- cgit v1.2.3