From 6c767194d9470b368f8d337e0719795f235f683c Mon Sep 17 00:00:00 2001 From: Peter Stone Date: Mon, 23 Mar 2026 00:42:44 +0000 Subject: fix: parse Todoist local datetimes, show near-future tasks, add undated tasks to timeline MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - parseDueDate: handle date field containing "YYYY-MM-DDTHH:MM:SS" (local time, no tz offset) — Todoist REST API v1 uses this format for recurring tasks with a set time, causing due dates to silently parse as nil - IsFuture threshold: widen from tomorrow to 7 days out so tasks due this week show in the main tasks section with dates visible (not collapsed) - BuildTimeline: include undated Todoist tasks in the Today section (mirrors existing Google Tasks behavior) - GetUndatedTasks: new store method for tasks with due_date IS NULL Co-Authored-By: Claude Sonnet 4.6 --- internal/store/sqlite.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'internal/store/sqlite.go') diff --git a/internal/store/sqlite.go b/internal/store/sqlite.go index 166cd63..f4651bb 100644 --- a/internal/store/sqlite.go +++ b/internal/store/sqlite.go @@ -723,6 +723,21 @@ func (s *Store) GetTasksByDateRange(start, end time.Time) ([]models.Task, error) return scanTasks(rows) } +// GetUndatedTasks retrieves incomplete tasks with no due date. +func (s *Store) GetUndatedTasks() ([]models.Task, error) { + rows, err := s.db.Query(` + SELECT id, content, description, project_id, project_name, due_date, priority, completed, labels, url, created_at + FROM tasks + WHERE due_date IS NULL AND completed = FALSE + ORDER BY priority DESC, created_at ASC + `) + if err != nil { + return nil, err + } + defer func() { _ = rows.Close() }() + return scanTasks(rows) +} + // GetMealsByDateRange retrieves meals within a specific date range func (s *Store) GetMealsByDateRange(start, end time.Time) ([]models.Meal, error) { return s.GetMeals(start, end) -- cgit v1.2.3