From be502a5856a680a821a1b5bd8266fa7599a552c9 Mon Sep 17 00:00:00 2001 From: interacsean Date: Tue, 13 Oct 2026 15:37:51 +1100 Subject: [PATCH] feat(date-field): add showDayOfWeek to DateField, DatePicker and DateRangePicker (#1883) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- .changeset/show-day-of-week.md | 9 ++ docs-manifest.json | 8 +- .../components/date-picker.docs.outline.md | 11 ++- docs/components/date-picker.md | 11 ++- .../src/pages/showcase/date-picker/page.tsx | 20 ++++ .../components/date-field/date-field.test.tsx | 93 +++++++++++++++++++ .../src/components/date-field/date-field.tsx | 8 ++ .../date-field/date-input-group.tsx | 40 +++++++- .../date-field/date-range-input-group.tsx | 2 + .../date-field/date-range-picker.test.tsx | 10 ++ .../date-field/date-range-picker.tsx | 4 + .../date-field/use-date-field-state.ts | 82 ++++++++++++---- 12 files changed, 270 insertions(+), 28 deletions(-) create mode 100644 .changeset/show-day-of-week.md diff --git a/.changeset/show-day-of-week.md b/.changeset/show-day-of-week.md new file mode 100644 index 000000000..ac4c56de6 --- /dev/null +++ b/.changeset/show-day-of-week.md @@ -0,0 +1,9 @@ +--- +"@tailor-platform/app-shell": minor +--- + +Add `showDayOfWeek` to `DateField`, `DatePicker`, and `DateRangePicker`. It appends the locale's short day of the week where the locale places it (`2025/12/19(金)`, `Fri, 12/19/2025`). It is read-only and derived from the entered date. While a date segment is mid-entry it keeps showing 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. + +```tsx + +``` diff --git a/docs-manifest.json b/docs-manifest.json index 06036a7e7..749f4e4b3 100644 --- a/docs-manifest.json +++ b/docs-manifest.json @@ -470,10 +470,10 @@ "DateRangePickerProps" ], "hashes": { - "typeSurface": "6b07d4169fa991df", - "outline": "caab56e5766bdb72", + "typeSurface": "a0f5522359e8f81d", + "outline": "50e117ad2a0562ba", "snapshot": null, - "outputMd": "f39002ad79625dc4", + "outputMd": "bc69f14829004f9d", "examples": null } }, @@ -1694,7 +1694,7 @@ "packages/core/skills/app-shell-patterns/references/components/command-palette.md": "7e5bc675a593791a", "packages/core/skills/app-shell-patterns/references/components/csv-importer.md": "53d3c795ca21b9dc", "packages/core/skills/app-shell-patterns/references/components/data-table.md": "3e8474e4d1437c91", - "packages/core/skills/app-shell-patterns/references/components/date-picker.md": "f39002ad79625dc4", + "packages/core/skills/app-shell-patterns/references/components/date-picker.md": "bc69f14829004f9d", "packages/core/skills/app-shell-patterns/references/components/default-header.md": "375e55f4b12fa2be", "packages/core/skills/app-shell-patterns/references/components/default-sidebar.md": "3422388a0cc78571", "packages/core/skills/app-shell-patterns/references/components/description-card.md": "a347fd1f4ccd433e", diff --git a/docs-src/components/date-picker.docs.outline.md b/docs-src/components/date-picker.docs.outline.md index 81d3a8219..d6a97abd2 100644 --- a/docs-src/components/date-picker.docs.outline.md +++ b/docs-src/components/date-picker.docs.outline.md @@ -183,6 +183,14 @@ Locale and timezone come from AppShell automatically. Override per field with `l ``` +### Day of the week + +`showDayOfWeek` adds the locale's short day of the week where the locale places it — `2025/12/19(金)` for ja-JP, `Fri, 12/19/2025` for en-US. It is read-only and derived from the entered date: it shows a placeholder until the date is complete, and while a date segment is mid-entry it keeps the previous day of the week (muted), so typing `25` into the day never flashes the 2nd's. Screen readers hear the full day name with each date segment's value. + +```tsx + +``` + ## Keyboard - **Segments:** `↑`/`↓` increment/decrement, digits type-to-fill (auto-advance), `←`/`→` move between segments, `Backspace` clears, `/` commits the current segment and advances. @@ -209,6 +217,7 @@ Locale and timezone come from AppShell automatically. Override per field with `l | `hourCycle` | `12 \| 24` | Force 12- or 24-hour time; defaults to the locale | | `autoFocus` | `boolean` | Focus the first segment on mount | | `locale` | `string` | BCP-47 locale override | +| `showDayOfWeek` | `boolean` | Show the locale's short day of the week next to the date | | `name` | `string` | Emits a form value through the proxy input | | `id` | `string` | Proxy input id (use with external `