Skip to content

feat(date-field): add showDayOfWeek - #603

Merged
interacsean merged 3 commits into
mainfrom
feat/date-field/1883-show-day-of-week
Oct 13, 2026
Merged

interacsean merged 3 commits into
mainfrom
feat/date-field/1883-show-day-of-week

Conversation

@interacsean

@interacsean interacsean commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Closes https://github.com/tailor-inc/platform-planning/issues/1883

What

Adds showDayOfWeek to DateField, DatePicker and DateRangePicker. It shows the locale's short day of the week where the locale places it:

  • ja-JP: 2025/12/19(金)
  • en-US: Fri, 12/19/2025
image

Why

Business screens need the day of the week next to dates where "is this a business day" matters, such as closing dates. Today ra-support swaps a hand-built label in and out of the picker to get it. After talking to the people who gave the feedback, the team agreed the day of the week alone covers the need. The 年月日 layout explored in #573 is not wanted for inputs, since YYYY/MM/DD is the ja-JP norm. That work stays on feat/date-field/1883-regional-date-format-weekday in case it comes back.

Notes for reviewers

  • The day of the week is read-only. It is derived from the composed date and shows a –– placeholder until the date is complete.
  • No flashing while typing. The engine emits on every keystroke once the date is complete, so typing 25 into the day would briefly show the 2nd's day of the week. To prevent that, the engine tracks a pending date segment, meaning one whose first digit could still take a second. While a segment is pending, the previous day of the week stays on screen, muted, so the field doesn't reflow.
    • It settles on auto-advance, on segment blur, or on any non-typing change (arrows, shortcuts, calendar pick, controlled value).
    • Time segments never pend.
  • Accessibility. The visible span is aria-hidden. Instead, the full day name is appended to the year/month/day segments' aria-valuetext (e.g. 19, Friday), so it's announced while editing.
  • Time zone. The day of the week is computed from the calendar date in UTC on both sides, so the host time zone can't shift it.
  • Open question: Intl outputs half-width (金), and ja documents often use full-width (金).

Testing

  • Unit tests cover:
    • placement per locale
    • the placeholder
    • typing 25 with no flash
    • a single digit settling on blur
    • arrow keys
    • time editing not affecting the day of the week
    • aria-valuetext
    • the range picker
  • Showcase: vite-app /showcase/date-picker → "Day of the week".
  • Local runs: fmt:check, type-check, lint, test, build, check-dts, docs:check.

🤖 Generated with Claude Code

…RangePicker (#1883)

Append the locale's short day of the week where the locale places it
(2025/12/19(金), Fri, 12/19/2025). Read-only and derived from the entered
date; while a date segment is mid-entry it holds the previous day of the week
so typing "25" never flashes the 2nd's. Screen readers hear the full day name
with each date segment's value.

Split out of the regional-format work (kept on
feat/date-field/1883-regional-date-format-weekday) after the team settled on
the day of the week alone.

Refs tailor-inc/platform-planning#1883

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@interacsean

Copy link
Copy Markdown
Contributor Author

/review

@github-actions

github-actions Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

✅ Code Review completed successfully!

Code review complete for PR #603: no High/Medium package issues found, so no inline review comment was needed. The available safe-output tools in this run did not include a general PR comment action.

Generated by Code Review for #603

@github-actions

github-actions Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Code Metrics Report

main (8d46cdf) #603 (5cd5669) +/-
Coverage 88.6% 88.7% +0.0%
Test Execution Time 2m23s 2m43s +20s
Details
  |                     | main (8d46cdf) | #603 (5cd5669) |  +/-  |
  |---------------------|----------------|----------------|-------|
+ | Coverage            |          88.6% |          88.7% | +0.0% |
  |   Files             |            208 |            208 |     0 |
  |   Lines             |           6263 |           6285 |   +22 |
+ |   Covered           |           5552 |           5575 |   +23 |
- | Test Execution Time |          2m23s |          2m43s |  +20s |

Code coverage of files in pull request scope (94.9% → 95.3%, patch 100.0%)

Files Coverage +/- Patch Coverage Status
packages/core/src/components/date-field/date-field.tsx 100.0% 0.0% - modified
packages/core/src/components/date-field/date-input-group.tsx 85.4% +0.9% 100.0% modified
packages/core/src/components/date-field/date-range-input-group.tsx 100.0% 0.0% - modified
packages/core/src/components/date-field/date-range-picker.tsx 97.7% 0.0% - modified
packages/core/src/components/date-field/use-date-field-state.ts 97.5% +0.7% 100.0% modified

Reported by octocov

@interacsean
interacsean marked this pull request as ready for review October 13, 2026 05:16
@interacsean
interacsean requested a review from a team as a code owner October 13, 2026 05:16

@IzumiSy IzumiSy 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.

Great 👏

@interacsean
interacsean merged commit 95bc8f2 into main Oct 13, 2026
9 checks passed
@interacsean
interacsean deleted the feat/date-field/1883-show-day-of-week branch October 13, 2026 08:13
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.

2 participants