Skip to content

Size date and time editor fields by terminal display width - #1493

Draft
Rajvira10 wants to merge 1 commit into
pimutils:masterfrom
Rajvira10:fix/wide-date-editor-fields
Draft

Rajvira10 wants to merge 1 commit into
pimutils:masterfrom
Rajvira10:fix/wide-date-editor-fields

Conversation

@Rajvira10

Copy link
Copy Markdown

Japanese date formats such as %Y年%m月%d日 wrap across two lines in the event editor even when the terminal has ample space. The field widths currently use len(), which counts each Japanese marker as one character although it occupies two terminal columns.

Measure date and time text with Urwid's text layout engine. Apply this to the standalone date editor and the event editor's date/time columns. The same fix covers wide characters in time formats such as %H時%M分.

Fixes #1412. This is independent of #1492: it changes editor-field sizing, while #1492 changes weekday-heading parsing. Neither branch depends on the other.

Validation on Python 3.14:

  • Before the fix: six rendering regressions fail, four ASCII/control cases pass.
  • After the fix: all ten new rendering cases pass, covering standalone dates, event start/end dates and times, and all-day events. No extra system locale is required for these tests.
  • Manually rendered the Japanese date/time editor with an isolated Japanese locale; complete dates and times remain on their respective rows.
  • Full suite with the minimum supported Urwid 2.6.15: 349 passed, 3 xfailed, 2 xpassed.
  • Full suite with Urwid 4.2.5: 348 passed, 3 xfailed, 2 xpassed, one failure in the existing test_convert_to_date leading-zero assertion. That same assertion fails on untouched upstream with identical dependencies (also documented in Fix weekday heading alignment for single-letter abbreviations #1492).
  • Project-pinned Ruff 0.15.7 repository lint and changed-file formatting checks pass; git diff --check passes.

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.

dates with japanese locale dont fit the width

1 participant