diff options
| author | Peter Stone <thepeterstone@gmail.com> | 2026-03-23 00:42:44 +0000 |
|---|---|---|
| committer | Peter Stone <thepeterstone@gmail.com> | 2026-03-23 00:42:44 +0000 |
| commit | 6c767194d9470b368f8d337e0719795f235f683c (patch) | |
| tree | 9ffbef1dfa45add88a821877a2e6c8ceb94f52f8 /internal/models/atom.go | |
| parent | 8abc63efdbc0bb96cd6c9aa99d6e9166e0bcabae (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/models/atom.go')
| -rw-r--r-- | internal/models/atom.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/internal/models/atom.go b/internal/models/atom.go index 9c519ba..3745917 100644 --- a/internal/models/atom.go +++ b/internal/models/atom.go @@ -57,15 +57,15 @@ func (a *Atom) ComputeUIFields() { tz := config.GetDisplayTimezone() now := config.Now() today := time.Date(now.Year(), now.Month(), now.Day(), 0, 0, 0, 0, tz) - tomorrow := today.AddDate(0, 0, 1) // Check if overdue (due date is before today) dueInTZ := a.DueDate.In(tz) dueDay := time.Date(dueInTZ.Year(), dueInTZ.Month(), dueInTZ.Day(), 0, 0, 0, 0, tz) a.IsOverdue = dueDay.Before(today) - // Check if future (due date is after today) - a.IsFuture = !dueDay.Before(tomorrow) + // Check if future (due date is 7+ days out — collapse in tasks tab) + sevenDaysOut := today.AddDate(0, 0, 7) + a.IsFuture = !dueDay.Before(sevenDaysOut) // Check if has set time (not midnight) a.HasSetTime = dueInTZ.Hour() != 0 || dueInTZ.Minute() != 0 |
