summaryrefslogtreecommitdiff
path: root/internal/store
diff options
context:
space:
mode:
authorPeter Stone <thepeterstone@gmail.com>2026-03-23 00:42:44 +0000
committerPeter Stone <thepeterstone@gmail.com>2026-03-23 00:42:44 +0000
commit6c767194d9470b368f8d337e0719795f235f683c (patch)
tree9ffbef1dfa45add88a821877a2e6c8ceb94f52f8 /internal/store
parent8abc63efdbc0bb96cd6c9aa99d6e9166e0bcabae (diff)
fix: parse Todoist local datetimes, show near-future tasks, add undated tasks to timeline
- 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 <noreply@anthropic.com>
Diffstat (limited to 'internal/store')
-rw-r--r--internal/store/sqlite.go15
1 files changed, 15 insertions, 0 deletions
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)