Repository navigation
fix(when): send a dated --when time as YYYY-MM-DD@HH:MM and read it back - #446
Merged
Merged
Conversation
A date, today or tomorrow with a time after the @ (today@6pm, tomorrow@18:00, 2026-10-12@9pm) went to Things as typed. placeWhen only places YYYY-MM-DD@HH:MM, so the read-back treated these as holding and reported them confirmed without a check. add, project add and edit now resolve such a value at send time with things.ResolveWhen: today and tomorrow become their dates when the command runs, and the time becomes HH:MM. That is the date and time form Things was measured with on 7 Oct 2026, so the existing read-back judges what was sent. A keyword with a time was never measured. Messages still name the value as typed. evening@ and weekday@ values are sent as before. Import is unchanged: it shares the read-back but sends its payload as written, and placeWhen and NormalizeWhen are untouched.
The no-op check now judges the value ResolveWhen sends, as the read-back does, so tomorrow@8am on an item already filed there with that reminder returns at once instead of waiting out the budget.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
A date,
todayortomorrowwith a time after the@(today@6pm,tomorrow@18:00,2026-10-12@9pm) went to Things as typed.placeWhenonly placesYYYY-MM-DD@HH:MM, so the read-back treated these values as holding and reported them confirmed without a check. A misfiled item went unnoticed. #443 fixed the same gap for a bare 12-hour time.Change
add,project addandeditnow resolve the value at send time with one helper,things.ResolveWhen. Today and tomorrow become their dates when the command runs, and the time becomesHH:MM:today@6pmis now sent as<today's date>@18:00tomorrow@9:30is sent as<tomorrow's date>@09:302026-10-12@9pmis sent as2026-10-12@21:00Things was never measured with a keyword and a time. This switches to the date and time form measured on 7 Oct 2026, so we no longer rely on how Things reads the keyword. The read-back and the edit no-op check now judge the value that was sent. Messages still show the value as typed.
Midnight edge: "tomorrow" means tomorrow relative to when the command runs. A
tomorrow@6pmsent just before midnight is the next day, even if Things reads it after midnight.TestResolveWhenpins this with a clock at 23:59:59.Not changed
evening@6pmand a weekday with a time (friday@9pm) are still sent as typed and not checked. Resolvingeveningto a date would file the item in the day part, and how Things readsfridayon a Friday was never measured.importsends its payload'swhenas written and is unchanged. It shares the read-back, butplaceWhenandNormalizeWhenare untouched, so its verdicts don't change.Tests
TestWhenDatedTimeReadBack:add,project addandeditwith each form sendYYYY-MM-DD@HH:MMand report a misfile. Before the change, each of these was confirmed.TestResolveWhen: the rewrites, the values left alone, and the midnight edge.TestEditCertainNoOpSkipsTheWait:tomorrow@8amon an item already filed there with that reminder counts as no change.