Repository navigation
feat: support time-of-day in due dates - #60
Merged
Merged
Conversation
Extend due-date parsing beyond whole-day deadlines: - ISO date-time: `YYYY-MM-DDTHH:MM[:SS]` and `YYYY-MM-DD HH:MM[:SS]` - Relative offsets: `today+HHMM`, `tomorrow+HHMM` (that day at HH:MM) and `now+HHMM` (HH hours, MM minutes from now); colon optional - A bare `now` keyword Due dates with a time render as `YYYY-MM-DD HH:MM` and are classified time-granularly (Overdue once the instant passes). Whole-day deadlines (local midnight) keep their date-granular behaviour, so `due:today` stays "due today" all day. Note: a `due:` token cannot contain a space, so the token form uses the `T` separator (`due:2026-07-01T14:30`); the `--due` flag accepts the quoted space form too. Updates CLI/TUI/MCP help text and docs. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
There was a problem hiding this comment.
Pull request overview
Adds time-of-day support to due dates in taskbook-common, expanding parsing/formatting and switching status classification to be time-granular when a due time is present, while keeping whole-day (midnight) dues date-granular.
Changes:
- Extend due parsing to accept ISO date-times,
now, and relative+HHMMoffsets; update formatting to includeHH:MMwhen a time is present. - Update due-status logic to flip timed dues to
Overdueonce the instant passes (while preserving all-day behavior for midnight dues). - Refresh CLI/TUI/MCP/docs help text and add unit tests for the new formats.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| crates/taskbook-common/src/due.rs | Core parsing/formatting/status logic updated for time-of-day dues + added unit tests |
| crates/taskbook-common/src/board.rs | Update CLI token help text and add a parsing test for due:...T... |
| crates/taskbook-client/src/tui/command_parser.rs | Update /task usage hint to reflect time-capable due tokens |
| crates/taskbook-client/src/mcp/tools.rs | Update MCP JSON schema descriptions for new due-date formats |
| crates/taskbook-client/src/main.rs | Add CLI help examples demonstrating due date-times and relative offsets |
| CLAUDE.md | Update docs/examples for the expanded due-date syntax |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+71
to
+77
| let dt = match offset { | ||
| None => base_dt, | ||
| Some(off) => { | ||
| let (hours, minutes) = parse_hhmm(off)?; | ||
| base_dt + Duration::hours(hours) + Duration::minutes(minutes) | ||
| } | ||
| }; |
Comment on lines
128
to
132
| if args.is_empty() { | ||
| return Err(ParseError { | ||
| message: "Usage: /task [@board] description [p:1-3] [due:YYYY-MM-DD]".to_string(), | ||
| message: "Usage: /task [@board] description [p:1-3] [due:YYYY-MM-DD[THH:MM]]" | ||
| .to_string(), | ||
| }); |
Comment on lines
37
to
41
| "boards": { "type": "array", "items": { "type": "string" }, "description": "Boards to place the task on (defaults to My Board)" }, | ||
| "priority": { "type": "integer", "minimum": 1, "maximum": 3, "description": "1 = normal, 2 = medium, 3 = high (default 1)" }, | ||
| "tags": { "type": "array", "items": { "type": "string" }, "description": "Tags for the task" }, | ||
| "due_date": { "type": "string", "description": "Due date: YYYY-MM-DD, today, or tomorrow" } | ||
| "due_date": { "type": "string", "description": "Due date: YYYY-MM-DD, 'YYYY-MM-DD HH:MM', today, tomorrow, now, or today+HHMM / tomorrow+HHMM / now+HHMM" } | ||
| }, |
Comment on lines
76
to
80
| "id": { "type": "integer", "description": "Item id" }, | ||
| "description": { "type": "string", "description": "New description" }, | ||
| "priority": { "type": "integer", "minimum": 1, "maximum": 3, "description": "New priority (tasks only)" }, | ||
| "due_date": { "type": "string", "description": "New due date (YYYY-MM-DD, today, tomorrow) or 'none' to clear (tasks only)" }, | ||
| "due_date": { "type": "string", "description": "New due date (YYYY-MM-DD, 'YYYY-MM-DD HH:MM', today, tomorrow, now, today+HHMM / tomorrow+HHMM / now+HHMM) or 'none' to clear (tasks only)" }, | ||
| "boards": { "type": "array", "items": { "type": "string" }, "description": "Replace the item's boards" }, |
| tb --move @<id> board # Move to board | ||
| tb --priority @<id> <1-3> # Set priority | ||
| tb --due @<id> <date> # Set due date (YYYY-MM-DD, today, tomorrow) or none to clear | ||
| tb --due @<id> <date> # Set due date (YYYY-MM-DD[ HH:MM], today, tomorrow, now, *+HHMM) or none to clear |
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.
Closes #58.
What
Adds time-of-day support to due dates, which were previously whole-day deadlines only.
New accepted formats (in addition to
YYYY-MM-DD,today,tomorrow):YYYY-MM-DDTHH:MM[:SS]andYYYY-MM-DD HH:MM[:SS]today+HHMM,tomorrow+HHMM(that day atHH:MM), andnow+HHMM(HHhours /MMminutes from now). The colon is optional (14:30==1430).nowkeywordBehaviour
YYYY-MM-DD HH:MMand are classified time-granularly — they flip toOverdueonce the instant passes.due:todaystays due today all day (no regression).Entry-path nuance
A
due:token is whitespace-split, so it can't contain a space — the token form uses theTseparator (due:2026-07-01T14:30). The--dueflag accepts the quoted space form too (--due @3 "2026-07-01 14:30").Touched
taskbook-common/src/due.rs— parsing, formatting, status (core change)CLAUDE.mddocsTest plan
cargo test --workspace— green (new unit tests cover ISO date-time, space separator, seconds, midnight-renders-as-date,today+/tomorrow+/now+offsets, invalid offsets, and time-granular vs whole-day status)cargo clippy --workspace --all-targets— cleancargo fmt --all --check— clean🤖 Generated with Claude Code