Skip to content

Let the date field take a typed hyphen - #423

Open
jeremy wants to merge 1 commit into
mainfrom
fanB-368
Open

Let the date field take a typed hyphen#423
jeremy wants to merge 1 commit into
mainfrom
fanB-368

Conversation

@jeremy

@jeremy jeremy commented Sep 9, 2026

Copy link
Copy Markdown
Member

Fixes #368

Repro

The TUI's date field (event form start/end, repeat-until, and every other dateTimePicker) read - and + as day-step keys, on the theory that neither can appear in YYYY-MM-DD. The hyphen is the format's delimiter, so a date could not be typed: keying 2026-09-14 left 20260914 in the field, which the picker then refused with "Date must be YYYY-MM-DD". / reached the input and was refused for the same reason, which is the behaviour the reporter saw.

TestDateTimePickerTypesADateWithItsHyphens types a date into an emptied field and fails on main exactly that way.

Fix

dateStep answers only the arrows now; every printable key reaches the text input. +/= went with -: they were an undocumented extra (the help line only ever showed ↑↓ day), and keeping one side of the pair would leave an asymmetric binding nobody can discover. The existing step test now steps back with ↑ where it used +.


Summary by cubic

Fixes #368: the TUI date field now lets you type hyphens in YYYY-MM-DD dates instead of treating - as a day-step key. The undocumented +/= step keys are gone too; only the arrow keys step the date.

Written for commit 7a62afd. Summary will update on new commits.

Review in cubic

The date picker read - and + as day steps, on the theory that neither
can appear in YYYY-MM-DD. The hyphen is the format's delimiter, so a date
could not be typed at all: the input showed 20260914 and refused it.
Only the arrows step now; every printable key reaches the input.
Copilot AI balanced review requested due to automatic review settings September 9, 2026 23:19
@jeremy
jeremy requested a review from a team as a code owner September 9, 2026 23:19
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 9, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-09T23:21:38.861118Z 7a62afd PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The behavioral change is tightly scoped, aligns with the reported repro, and is covered by a targeted regression test.

Pull request overview

This PR fixes the TUI dateTimePicker so users can type full YYYY-MM-DD dates (including the - delimiter) by limiting “step date by a day” behavior to only the Up/Down arrow keys.

Changes:

  • Restrict date stepping to ↑/↓ only; allow all printable keys (including -) to flow to the date text input.
  • Update the existing step-by-day test to use instead of +.
  • Add a regression test that types a hyphenated date and asserts it parses cleanly.

[!TIP]
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

File summaries
File Description
internal/tui/datetime.go Removes +/- stepping bindings so hyphens can be typed into the date field; keeps day-stepping on arrow keys only.
internal/tui/datetime_test.go Updates stepping test to use arrow keys and adds a regression test for typing hyphenated dates.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HEY TUI Cannot enter the "-" in the date field

2 participants