Repository navigation
feat(DateInput, DateTimeInput): a non-Gregorian calendar uses the Astryx picker - #10031
nynexman4464 wants to merge 24 commits into
Conversation
Both inputs take a calendar prop and otherwise follow the provider's calendar. useTypedDate reads typed text with the calendar-date parser, commits once per complete date, and names unreadable, missing, and out-of-range dates. The popover calendar and the date formats follow the calendar; values stay Gregorian ISO dates.
… fallback - The accessible description names the calendar only when the field's calendar differs from the provider's calendar, after the Gregorian fallback, so an all-Persian app never repeats it and a Gregorian field in a Persian app names the Gregorian calendar. - Gregorian text that the calendar parser reads as a nonexistent date falls back to parseDateInput on Enter or blur, so 13/5/2026 in en-US still commits as 13 May 2026. A date neither reads stays rejected. - A caller placeholder replaces the format hint in every state. - The hint's example date is today when the field accepts it, else the nearest accepted date, from a new nearestAcceptedDate helper.
…r the Enter requirement DateInput FR16 and DateTimeInput FR10 already name the Enter-and-form-submit rule, so typed entry in a calendar is DateInput FR17 and DateTimeInput FR11.
… reading Letter-free text that parseDateInput does not read in a day-first locale is not a date, so the Gregorian fallback leaves it unread.
…retyped date again Text kept on Enter or blur shows its error as the field status, and a status the field shows is not announced a second time by the field's own alert. A commit ends the typing session, so a date retyped after the caller keeps its value is reported again. The provider docs and record say that the popover field follows the calendar while the bottom-sheet and native surfaces stay Gregorian, and the records state that an explicit -u-ca- locale is the application's request.
…ler status Kept rejected text now shows its own error as the field status even when the caller sets status, so the reason is visible and not only announced. The changeset also says that a date only a dateConstraints rule rejects says it is not available.
…ian dates The DateInput and DateTimeInput records and the changeset say that a provider locale with a -u-ca- keyword keeps Gregorian dates; set calendar to choose one.
…ts and what typed text stays parseDateInput reads only text the field cannot otherwise read and a date the locale's field order lacks; a one- or three-digit year is not a date. DateTimeInput's committed date-time row keeps rejected date text, as FR11 does. INV10 names the popover fields of DateInput and DateTimeInput among the displays that follow the calendar. The invalid-date and format-hint message descriptions match the field.
…wo-digit year window DateTimeInput FR11 commits on Enter or blur only the text that DateInput FR20 names: text the field cannot otherwise read and a date the locale's field order lacks, with a one- or three-digit year not a date. DateInput FR6 drops the month-first fallback for a two-digit year, which the calendar parser now reads, and the compatibility line names the two-digit year window.
… row; a date editor shows dates as its input does
…ryx picker The native date control shows only Gregorian dates. In a calendar other than gregory or iso8601, native and adaptive-native use the popover on a fine pointer and the bottom sheet on a coarse pointer, and an explicit native warns in development. AST-043 FR1 and FR3 name the exception.
…g and presentation useTypedDate calls isGregorianCalendar, the same test that decides when the native control can show the calendar. The presentation test names read the expected surface, and the warning comment says what keys it. The provider docs and record say that only the bottom sheet stays Gregorian, and the changeset says that an explicit -u-ca- locale selects the calendar the same way.
The changeset says that a provider locale with a -u-ca- keyword keeps Gregorian dates and the native control; set calendar to choose a calendar.
… narrow the calendar surface claims DateInput's compatibility row keeps the sheet wheels' markup and time-order key sentences (FR17) and changes only the touch-surface calendar entry. DateTimeInput's calendar shows in the date segment and its popover. On a coarse pointer the field and its bottom sheet show Gregorian dates. The dense nativePicker docs name the calendar exception.
…s in the field too
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
|
/approve-spec 892bc18 |
There was a problem hiding this comment.
This pull request is reviewed as part of its stack; see the review on #9842.
PR Analysis Report🔎 Preview ·
|
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| Calendar · Storybook | 57.4 kB (0) · 9.3 kB CSS (0) | 1,714 (0) | ✗ · ✓ · ✓ |
| PowerSearch · Storybook | 🔴 256.8 kB (+7.1 kB) · 22.3 kB CSS (0) | 7,201 (0) | ✓ · ✓ · ✓ |
| DateInput · Storybook | 🔴 161.8 kB (+6.8 kB) · 15.5 kB CSS (0) | 5,391 (+288) | ✓ · ✓ · ✓ |
6 more components
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| DateTimeInput · Storybook | 🔴 183.7 kB (+6.6 kB) · 17.2 kB CSS (0) | 3,623 (+58) | ✓ · ✓ · ✓ |
| DateRangeInput | 75.8 kB (0) · 11.2 kB CSS (0) | — | — · — · — |
| TimeInput | 140.4 kB (0) · 14.5 kB CSS (0) | — | — · — · — |
| Timestamp | 22.9 kB (0) · 8.9 kB CSS (0) | — | — · — · — |
| lab/Comments | 271.5 kB (new) · 2.5 kB CSS (new) | — | — · — · — |
| lab/CommentThread | 266.4 kB (new) · 2.4 kB CSS (new) | — | — · — · — |
Visual changes: 2 snapshots in 1 component
A change is a question for the reviewer, not a failure.
| Component · story | Before | After | Diff |
|---|---|---|---|
| Calendar · Default (neutral, light) | ![]() |
![]() |
![]() |
| Calendar · Default (neutral, dark) | ![]() |
![]() |
![]() |
Package size: measured; main has no measurement of the merge base to compare yet.
API changes: cli +8 · ~1 · −0 (against the merge base's committed report); core +2 · ~0 · −0
Committed API report behind this build: cli 9 rows, core 3 rows; run pnpm api:report.
11 API changes (advisory)
| Package | Where | Signature | Usage | |
|---|---|---|---|---|
| + | cli |
./api · Types · type SearchResultEntry |
deprecated?: ComponentDeprecation | undefined |
import type {SearchResultEntry} from '@astryxdesign/cli/api'; const x: SearchResultEntry = {deprecated: …} |
| + | cli |
./authoring · Types · interface ComponentDeprecation |
interface ComponentDeprecation |
import type {ComponentDeprecation} from '@astryxdesign/cli/authoring' |
| + | cli |
./authoring · Types · interface MultiComponentDoc |
deprecated?: ComponentDeprecation |
import type {MultiComponentDoc} from '@astryxdesign/cli/authoring'; const x: MultiComponentDoc = {deprecated: …} |
| + | cli |
./authoring · Types · interface SingleComponentDoc |
deprecated?: ComponentDeprecation |
import type {SingleComponentDoc} from '@astryxdesign/cli/authoring'; const x: SingleComponentDoc = {deprecated: …} |
| + | cli |
./doc · Types · interface ComponentBaseDoc |
deprecated?: ComponentDeprecation |
import type {ComponentBaseDoc} from '@astryxdesign/cli/doc'; const x: ComponentBaseDoc = {deprecated: …} |
| + | cli |
./doc · Types · interface SubComponentDoc |
deprecated?: ComponentDeprecation |
import type {SubComponentDoc} from '@astryxdesign/cli/doc'; const x: SubComponentDoc = {deprecated: …} |
| + | cli |
./doc · Also exported from an earlier entry point · ComponentDeprecation |
ComponentDeprecation (./authoring) |
import {ComponentDeprecation} from '@astryxdesign/cli/doc' |
| + | cli |
./template · Also exported from an earlier entry point · ComponentDeprecation |
ComponentDeprecation (./authoring) |
import {ComponentDeprecation} from '@astryxdesign/cli/template' |
| ~ | cli |
./api · Functions · function search |
function search: (query: string, options?: { cwd?: string | undefined; type?: "template" | "component" | "hook" | "theme" | "doc" | undefined; limit?: number | undefined }) => Promise<SearchResponse> → function search: (query: string, options?: { cwd?: string | undefined; type?: "template" | "component" | "doc" | "theme" | "hook" | undefined; limit?: number | undefined }) => Promise<SearchResponse> |
import {search} from '@astryxdesign/cli/api'; search(…) |
| + | core |
. · Components · component DateInput |
prop calendar?: CalendarSystem = the InternationalizationProvider's calendar, else `'gregory'` |
<DateInput calendar="s calendar, else `" /> |
| + | core |
. · Components · component DateTimeInput |
prop calendar?: CalendarSystem = the InternationalizationProvider's calendar, else `'gregory'` |
<DateTimeInput calendar="s calendar, else `" /> |
Touched components checked; add ci:run-visual, ci:run-a11y or ci:run-rtl to run the full suites.
Generated by PR Enrichment workflow | View full report
…ates in the active calendar (#9643, #9842) Lands the declared stack #9643 → #9842; each part was reviewed on its own pull request. - #9643 (with #10031, #9794, #9653 and #9837 folded in): DateInput and DateTimeInput read and write typed dates in the active calendar; a non-Gregorian calendar uses the Astryx picker instead of the native control; the bottom sheet shows months of the calendar; DateRangeInput shows the range in the calendar; one shared typed-entry hook serves both fields. - #9842: while DateInput or DateTimeInput is disabled or busy, typed text stays without a rejection, and commits or gives way once the field is editable. Fixes #8958.






Stack: #9643 → #10031 → #9794 → #9653 → #9837 → #9842
This implements
spec:AST-111(approved in #9605) FR15 and DEC-7, with FR5's fallback, forDateInputandDateTimeInput.User need
A Persian, Hebrew, or Japanese user on a phone opens a date field and sees the native date picker. That picker is Gregorian (Android) or follows the device calendar (iOS), so the date they pick reads as a different date than the field shows. On a desktop, an explicit
presentation="native"has the same problem.Problem and solution fit
gregoryoriso8601, every presentation that would show<input type="date">uses the Astryx popover on a fine pointer and the bottom sheet on a coarse pointer. This coversadaptive-native(the default), the deprecatednativePickervalues, and an explicitpresentation="native", which also warns once in development (DEC-7). DateTimeInput's date and time surfaces follow the same rule.useCalendarPresentationresolves the calendar and the presentation policy it allows;calendarPickerPresentationininputPresentation.tsmapsnativeandadaptive-nativetoadaptive-bottom-sheet;isGregorianCalendarin the calendar-system utility names the calendars the native control can show, anduseTypedDatenow uses it too.Temporal, calendars that need it fall back to Gregorian, and with them the native control (FR5). A-u-ca-keyword in the provider locale does not select the calendar, so such a field keeps Gregorian dates and the native control;calendaron the component or the provider selects one.calendarJSDoc, the consumer docs forcalendarand the changeset say that on a coarse pointer the field and its bottom sheet show Gregorian dates, and the densenativePickerdocs name the calendar exception.Current specification
spec:AST-111FR15, FR3, FR5 and DEC-7 (approved in spec(AST-111): date components use the calendar the application chooses #9605).spec:AST-043FR1–FR3 now name the one exception to an explicitnative: the calendar.component:DateInputFR21 andcomponent:DateTimeInputFR12, each with a Current-state gap for the Gregorian bottom sheet.component:InternationalizationProviderFR10 now says only the bottom sheet andDateRangeInputshow Gregorian dates. The provider's docs and JSDoc say the same and keepmain's statement that Timestamp, PowerSearch, and Lab's Schedule write their dates in the calendar.Public delta and caller burden
nativewarns once in development.gregory/iso8601, and no change withoutTemporalfor the calendars that need it.Design and alternatives
spec:AST-111DEC-7): keeping an explicitnativenative. The device, not the application, would then choose the calendar.Evidence
nativePickervalue × Gregorian/Persian × fine/coarse pointer for DateInput and DateTimeInput, the provider calendar, and the explicit-native warning (once, and not for Gregorian or the defaults).Temporaltests: a Persian field becomes Gregorian with the native control and a warning; an explicitnativestays native; a Persian bottom sheet shows Gregorian months; a Persian DateTimeInput shows Gregorian native controls.Temporal, with the polyfill, and with noTemporal; WebKit (Safari 26.5) with the polyfill and with noTemporal.Screenshots
Chromium 149 with native Temporal unless noted.
Scope
Testing
pnpm exec vitest run --maxWorkers=4over the presentation and no-Temporaltests,packages/core/src/i18n,docPropLiterals.test.tsand the CLI core prop docs test, after the restack onto currentmain(with Lab's Schedule): 16 files, 218 tests passed. CI runs the full suites.docPropLiterals.test.ts: 5 files, 38 tests pass.pnpm exec tsc --noEmit -p packages/core: passes.pnpm check:knowledge,pnpm check:changesets: pass.node scripts/pre-review.mjs --base nynexman4464/feat/calendar-typed-entry: 1,072 authored lines.Writing rubric results
spec:AST-043component:DateInput(#5074)is part of a quoted test title.component:DateTimeInputcomponent:InternationalizationProvider