Repository navigation
fix(when): send weekday names as their date and check evening@time, in add, edit and import - #458
Merged
Merged
Conversation
…n add, edit and import
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.
Measured in Things 3 on Saturday 10 Oct 2026: a weekday name means the next such day strictly after today (today + 1..7), and a time after it only sets the reminder.
evening@Tfiles the item This Evening, today, with a reminder at T, any time included. Until now the CLI sent both as typed and reported them "not confirmed (--when not checked)" after #453. Import refusedfriday@9pmand reported an uncheckedwhenas confirmed.What is sent
friday/Friday2026-10-16friday@9pm2026-10-16@21:00saturday,saturday@9am,saturday@9pm2026-10-17[@HH:MM](a week on)sunday@9am2026-10-11@09:00evening@6pm/Evening@9amevening@18:00/evening@09:00fri,fri@9pm,next fridayThis applies to
add,project add,editandimport(throughresolveImportWhens). A bare weekday is resolved too: Things givesfridayand2026-10-16the same place, and the date form is the measured one. Abbreviations were not measured, so they still go as typed.Changes
things.ResolveWhenresolves full weekday names (case-insensitive), alone or with a time, and normalisesevening@Ttoevening@HH:MM.TimedWhenWord(timed keyword or weekday name) replacesTimedWhenKeywordincheckWhenShapeandWhenDateOrTime. Sofriday@25:00is now refused liketomorrow@25:00, andfriday@9pmis no longer a free phrase (an edit of it alone is read back).placeWhenandwhenPlacedshare one parse step (parseWhen), which also placesevening@HH:MM.whenCheck.verdictreturnswhenUnplaced, so add and import judge an unplaced value the same way. Import now reports such an itemconfirmed: false, reasonwhen, withlanded, asCreated, not confirmed (when not checked): …, and exits 0. The reason is the same as a phrase Things did not understand. The plain-text line andlandedtell them apart.@(sent as its date).The read-back does not check the reminder for
evening@T, as it does not fortoday@6pm.Before / after
things add "Buy oat milk" --when friday@9pm:friday@9pm, outputCreated, not confirmed (--when not checked): "Buy oat milk" (<uuid>)with a warning.2026-10-16@21:00. Filed on the 16th, the item is printed (confirmed). Filed elsewhere:add did not apply as sent: … --when "friday@9pm" did not file it there: …(misfiled).things add "Buy oat milk" --when evening@6pm: same, sent asevening@18:00, confirmed when This Evening today.Import
{"when":"fri"}, which Things understood:Created and confirmed: …Created, not confirmed (when not checked): [0] "Pay rent" (<uuid>), scheduled for …Tests
TestResolveWhen(same weekday as today, past time, before midnight, abbreviations),TestWhenWeekdayEveningReadBack(clock pinned to a Saturday; add, project add and edit, landed and misfiled, URL sent),TestPlaceWhenevening cases,TestResolveImportWhens,TestImportChecksWhen(weekday misfiled, uncheckedfri), andTestCheckScheduleValue.make testandmake lintpass.