Skip to content

fix(json): report a scheduled row Things has not moved yet as anytime - #370

Merged
ryanlewis merged 2 commits into
mainfrom
fix/json-midnight
Oct 4, 2026
Merged

ryanlewis merged 2 commits into
mainfrom
fix/json-midnight

Conversation

@ryanlewis

Copy link
Copy Markdown
Owner

Just after midnight, a to-do scheduled for the new day can still have start = 2 until Things runs its day-change maintenance. #366 made the listings file it under today, as the app does, but --json still said "start": "someday".

The change

  • One SQL expression, shownStart in internal/db/tasks.go, decides the start a row reports. Both the task query (today, anytime, upcoming, show, search and the rest) and things projects use it.
  • An open, untrashed start = 2 row dated today or earlier (the same scheduledArrived test fix(views): list a scheduled row Things has not moved yet under today #366 uses) reports "anytime", the code Things gives it when it moves the row.
  • Closed and trashed rows keep "someday". Things never moves them: the live database held 22 closed and 17 trashed start = 2 rows dated days back. Repeating templates and the to-dos inside them keep "someday" too, as the views leave them out of today.
  • The task query now replaces every {{repeating}} placeholder, not just the first, because the select list carries it twice.

The plain-text listing also gains the today star on that row, as every other to-do scheduled for today has.

Checked against the live database (read-only)

At 01:59 on 4 Oct 2026, GEY9AMabfDMQk6KmNb3zTs was still in this state. I compared main with this branch across today, anytime, upcoming, someday, logbook, trash, repeating and projects, in plain text and JSON. The only differences were on that one row: "start": "someday" became "anytime" in the today and anytime JSON, and the row gained ★ in the plain-text today and anytime listings. Everything else was byte-identical.

Docs

SKILL.md, commands.md and agents.md now say such a row reports "anytime".

Just after midnight, a to-do scheduled for the new day can still be
start = 2 until Things runs its day-change maintenance. Since #366 the
listings file it under today, as the app does, but --json still said
"someday". The task and project queries now report start = 1 for an
open, untrashed row in that state, the code Things gives it when it
moves the row. Closed and trashed rows keep start = 2: Things never
moves them.

The plain-text listing gains the today star on that row, as every other
to-do scheduled for today has.
Things never moves a repeating template or a to-do inside one, so
shownStart leaves them at start = 2, as the views leave them out of
today. The task query now substitutes every placeholder rather than the
first, since the select list carries {{repeating}} twice.
@ryanlewis
ryanlewis merged commit 210a905 into main Oct 4, 2026
10 checks passed
@ryanlewis
ryanlewis deleted the fix/json-midnight branch October 4, 2026 01:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant