Skip to content

feat(DateInput, DateTimeInput, DateRangeInput): type, pick and show dates in the active calendar - #9643

Closed
nynexman4464 wants to merge 43 commits into
mainfrom
nynexman4464/feat/calendar-typed-entry
Closed

nynexman4464 wants to merge 43 commits into
mainfrom
nynexman4464/feat/calendar-typed-entry

Conversation

@nynexman4464

@nynexman4464 nynexman4464 commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Stack: #9643 → #9842

Declared stack: #9842 targets main and contains this pull request. This pull request carries five parts that were each reviewed on their own (#9643, #10031, #9794, #9653, #9837): the review asked for #9837's shared typed-entry hook in the same change as #9643's typed entry, so they land as one. Each part's description follows below.

Base is main.

This implements spec:AST-111 (approved in #9605) for DateInput, DateTimeInput and DateRangeInput: typed entry in the active calendar (FR9–FR14, AR2, AR3), the native-picker fallback (FR15, DEC-7), the calendar bottom sheet (FR16) and DateRangeInput's calendar (FR17), with FR2, FR3 and FR5. Fixes #8958.

Parts

Changes beyond the parts

  • calendars docs page: Calendar, DateInput, DateRangeInput and DateTimeInput show the Gregorian calendar unless the application chooses another one (it said the inputs stay Gregorian).
  • A [docs] changeset for the CLI covers the calendars docs line.
  • .changeset/calendar-systems-formatters.md (from feat(Timestamp, PowerSearch): write dates in the provider's calendar #9639): the sentence that a PowerSearch date editor still shows Gregorian dates is removed; every PowerSearch date editor now follows the provider's calendar.
  • The interim "still shows Gregorian dates" sentences are removed from the typed-entry and native-fallback changesets.

The testing and size lines inside each part were measured on that part alone against the part below it. CI runs the full suites on this head.


Part #9643: feat(DateInput, DateTimeInput): type dates in the active calendar

This implements spec:AST-111 (approved in #9605) for the text fields of DateInput and DateTimeInput: FR2 (their calendar prop), FR3, FR9–FR14, AR2 and AR3. Fixes #8958.

User need

People who use a calendar other than the Gregorian calendar can't type dates in it. The field reads only English month names and ASCII digits, and its committed text is Gregorian.

Gregorian fields also report wrong dates while someone is typing (#8958). A caller that saves or fetches on onChange therefore acts on partial input.

Problem and solution fit

  • useTypedDate reads the field's text with the calendar-date parser from the PR below, for every calendar, Gregorian included.
  • The fields:
    • take calendar; without it they use the provider's calendar, else gregory. A -u-ca- keyword in the provider locale does not select the calendar;
    • fire onChange while typing only for complete input, once per date (FR12);
    • keep a date the calendar does not have, or an out-of-range date, in the field with its error (FR11). The typed error shows even when the caller sets status;
    • announce a different message for each kind of rejection (AR3);
    • in a calendar other than Gregorian, show an example date in the empty focused field, unless the caller passes placeholder. The example is today when the field accepts it, else the nearest date it accepts (the shared nearestAcceptedDate helper from feat(core): read typed dates in every calendar #9792);
    • name the calendar in the field's description only when it differs from the provider's calendar; gregory and iso8601 count as one (AR2);
    • write committed text, and the date, date_long and date_weekday formats, in the calendar (FR13); system_date stays ISO;
    • open their popover Calendar in the field's calendar.
  • Gregorian compatibility: a Gregorian field falls back to parseDateInput on Enter or blur for text the new parser cannot read, and for a date the locale's field order does not have: 13/5/2026 in en-US commits as 13 May 2026, as it does on the latest release. parseDateInput itself is unchanged.
  • One- and three-digit years are not dates: 1/5/2 and 12/01/202 stay in the field on Enter or blur with the unreadable message, as nonexistent and out-of-range text do, and never commit, although parseDateInput reads 12/01/202. The parseDateInput fallback covers only text the new parser cannot read and dates the locale's field order lacks. Other unreadable text reverts.
  • Supporting changes: tests, the English catalog strings for the new messages (the invalid-date description now says that kept text shows it as the field status, and the format-hint description that the example is the nearest accepted date when today is not), docs, a story, the records and the API report.

Current specification

  • spec:AST-111 FR2, FR3, FR9–FR14, AR2 and AR3 (approved in spec(AST-111): date components use the calendar the application chooses #9605).
  • This PR adds component:DateInput FR20 and AR9, component:DateTimeInput FR11 and AR5, and a spec:AST-013 FR12 exception (calendars that need Temporal) to both records.
  • The provider and Calendar records, and architecture:internationalization INV10, now state that the popover fields of DateInput and DateTimeInput follow the calendar, while their other surfaces and DateRangeInput stay Gregorian. The provider's docs and JSDoc keep main's statement that Timestamp and PowerSearch write their dates in the calendar.
  • component:PowerSearch's Calendar line, and PowerSearch's timezoneID docs in English, Chinese and dense form, now say that a date value's editor is a DateInput, or a DateRangeInput for a date_range value, and shows dates the way that input does; where that input still shows Gregorian dates (for example DateInput's touch surfaces until the two PRs above, or DateRangeInput until feat(DateRangeInput): show the range in the calendar #9653), a token and its editor name one day in two calendars.
  • component:DateInput's FR20 verification row names the Gregorian text FR20 still commits (unreadable text, or a date the locale's order lacks) instead of all text parseDateInput reads.
  • DateTimeInput's typed-entry state logic: Part refactor(DateInput, DateTimeInput): share typed entry in useTypedDateField #9837 in this pull request moves it into the shared hook (useTypedDateField) with no behavior change.

Public delta and caller burden

  • New optional prop on both components: calendar?: CalendarSystem. It defaults to the provider's calendar, else 'gregory'. Values stay Gregorian ISO.
  • Gregorian typing changes:
    • onChange fires only for complete input, and once per date.
    • A two-digit year, or no year, commits on Enter or blur. A two-digit year reads within the 80 years before and 19 after the current year, 1946–2045 in 2026: 1/5/46 in en-US commits 1946, where parseDateInput gives 2046.
    • A one- or three-digit year, such as 1/5/2 or 12/01/202, is not a date: Enter or blur keeps the text and shows it as invalid.
    • An out-of-range typed date stays in the field with an error naming the range, instead of reverting. The error shows even when the caller sets status.
  • Example: before, <DateInput label="Start" value={d} onChange={setD} />. After, for Persian, <DateInput label="Start" calendar="persian" value={d} onChange={setD} />.
  • Buddhist and Minguo calendars: builders using these calendars should set min and max.
  • Not yet: the bottom sheet and the native picker still show Gregorian dates; the next PRs in the stack change that.

Design and alternatives

Evidence

  • Real browsers: Chromium 149 and Firefox 151, each with native Temporal, with Temporal removed and the polyfill loaded, and with no Temporal, against the Storybook story Core/DateInput/CalendarSystems. All checks pass:
    • Persian digits commit.
    • 30 Esfand 1404 is rejected and stays in the field.
    • A plain "Adar" in 5784 commits as Adar II.
    • Reiwa 1 commits, while Heisei 31-05-01 is rejected.
    • A Gregorian year in a Buddhist field shows the Buddhist bounds.
    • Without Temporal, the Persian field falls back to Gregorian with a warning.
  • Unchanged path: in the existing DateInput, DateTimeInput and Calendar suites, only the assertions listed below changed.

Changed assertions:

  • Enter and IME commit tests (DateInput and DateTimeInput) now type a two-digit year, because a complete date already fires while typing and fires only once (FR12).
  • "keeps a typed date that violates constraints and shows the bounds on blur" replaces the revert-on-blur test (FR11).
  • feat(Calendar): show the months of the selected calendar system #9622's calendar test: DateInput and DateTimeInput open their popover in the field's calendar. DateRangeInput stays Gregorian.

Screenshots

Chromium 149 with native Temporal unless noted.

State Screenshot
Persian field: format hint Persian field: format hint
Persian digits typed and committed Persian digits typed and committed
30 Esfand 1404 does not exist: rejected and kept 30 Esfand 1404 does not exist: rejected and kept
A plain "Adar" in 5784 commits Adar II A plain "Adar" in 5784 commits Adar II
Adar I in a common year is rejected Adar I in a common year is rejected
Reiwa 1 commits Reiwa 1 commits
Heisei 31-05-01 is outside its era: rejected Heisei 31-05-01 is outside its era: rejected
A Gregorian year in a Buddhist field shows the Buddhist bounds A Gregorian year in a Buddhist field shows the Buddhist bounds
Buddhist, th-TH digits Buddhist, th-TH digits
WebKit (Safari 26.5) with the polyfill: Persian committed WebKit (Safari 26.5) with the polyfill: Persian committed

Scope

  • One capability is added.
  • Unrelated fixes, cleanup, and policy changes were removed or split.
  • Consumer docs, focused tests, and migration evidence ship with the feature.
  • Public text and artifacts contain no internal Meta context.

Not included: the parser (the PR below), the bottom-sheet, native-picker and DateRangeInput calendars (FR15–FR17, the next PRs in the stack), and shared formatters (FR18, already on main).

Testing

  • pnpm exec vitest run --maxWorkers=4 over Calendar.calendarSystems.test.tsx and the DateInput and DateTimeInput tests and calendar tests, after the restack onto current main: 5 files, 337 tests passed. CI runs the full suites.
  • CLI docs tests (golden reads, core prop docs, core doc quality, core doc types) and docPropLiterals.test.ts: 5 files, 38 tests pass.
  • After the PowerSearch record and docs change: the PowerSearch tests, docPropLiterals.test.ts, and the CLI core prop docs and golden reads tests: 18 files, 570 tests pass.
  • pnpm exec tsc --noEmit -p packages/core: passes.
  • pnpm check:knowledge, pnpm check:changesets: pass.
  • node scripts/pre-review.mjs --base main: 1,990 authored lines, after a rebase onto main with feat(lab): Schedule writes dates in the provider's calendar #9994 (the provider docs keep main's Schedule mention).
  • Playwright against Storybook in Chromium and Firefox, with native Temporal, with the polyfill, and with no Temporal.

Writing rubric results

Records: component:DateInput, component:DateTimeInput, component:InternationalizationProvider, component:Calendar, architecture:internationalization and component:PowerSearch.

  • R1 narration: none. DateTimeInput FR11 now names what the date segment commits on Enter or blur in DateInput FR20's terms: text it cannot otherwise read and a date the locale's field order lacks, with a one- or three-digit year not a date. DateInput FR6 no longer claims a month-first fallback for two-digit years, and the Compatibility/readiness row names the two-digit year window. The compatibility lines state the change classes in the present tense, and the provider, Calendar and INV10 lines state which surfaces follow the calendar. DateInput's compatibility row and class, and FR20, say that parseDateInput reads only unreadable text and dates the locale's field order lacks, and that a one- or three-digit year is not a date. DateTimeInput's committed date-time row says that unreadable text reverts and that a date the calendar lacks, out of range, or incomplete stays for correction, matching FR11 and AR5.
  • R2 research: none in the records. The round-trip matrix lives in tests.
  • R3 evidence: the new verification cells cite test names and real-browser runs. No pull request or commit is cited.
  • R4 rejected alternatives: none added.
  • R5 change references: none added. One existing test title, quoted verbatim, contains an issue number.
  • R6 open questions: none added.

component:PowerSearch (Calendar line only)

  • R1 narration: none. The implementation-gap note names only the date_range editor, a DateRangeInput, which shows Gregorian dates, in the present tense.
  • R2 research: none.
  • R3 evidence: none changed.
  • R4 rejected alternatives: none.
  • R5 change references: none.
  • R6 open questions: none.

Part #10031: feat(DateInput, DateTimeInput): a non-Gregorian calendar uses the Astryx picker

This implements spec:AST-111 (approved in #9605) FR15 and DEC-7, with FR5's fallback, for DateInput and DateTimeInput.

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

  • FR15: with a calendar other than gregory or iso8601, 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 covers adaptive-native (the default), the deprecated nativePicker values, and an explicit presentation="native", which also warns once in development (DEC-7). DateTimeInput's date and time surfaces follow the same rule.
  • useCalendarPresentation resolves the calendar and the presentation policy it allows; calendarPickerPresentation in inputPresentation.ts maps native and adaptive-native to adaptive-bottom-sheet; isGregorianCalendar in the calendar-system utility names the calendars the native control can show, and useTypedDate now uses it too.
  • Values stay Gregorian ISO (FR3). Without 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; calendar on the component or the provider selects one.
  • Not yet: on a coarse pointer, the bottom sheet and the closed field text still show Gregorian dates. The next PR makes them follow the calendar (FR16). The records state the bottom sheet as an implementation gap. The calendar JSDoc, the consumer docs for calendar and the changeset say that on a coarse pointer the field and its bottom sheet show Gregorian dates, and the dense nativePicker docs name the calendar exception.
  • AST-043 FR1, FR2 and FR3, DateInput FR2 and DateTimeInput FR3 name the calendar exception.

Current specification

  • spec:AST-111 FR15, FR3, FR5 and DEC-7 (approved in spec(AST-111): date components use the calendar the application chooses #9605).
  • spec:AST-043 FR1–FR3 now name the one exception to an explicit native: the calendar.
  • Projected into component:DateInput FR21 and component:DateTimeInput FR12, each with a Current-state gap for the Gregorian bottom sheet.
  • component:InternationalizationProvider FR10 now says only the bottom sheet and DateRangeInput show Gregorian dates. The provider's docs and JSDoc say the same and keep main's statement that Timestamp, PowerSearch, and Lab's Schedule write their dates in the calendar.

Public delta and caller burden

  • Behavior: under a non-Gregorian calendar, no presentation renders a native date control. An explicit native warns once in development.
  • No change for gregory/iso8601, and no change without Temporal for the calendars that need it.
  • No new props or types.
  • Caller decisions: none. A field that needs the native picker stays Gregorian.

Design and alternatives

  • Rejected (spec:AST-111 DEC-7): keeping an explicit native native. The device, not the application, would then choose the calendar.

Evidence

  • Unit tests: every presentation and deprecated nativePicker value × 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).
  • No-Temporal tests: a Persian field becomes Gregorian with the native control and a warning; an explicit native stays native; a Persian bottom sheet shows Gregorian months; a Persian DateTimeInput shows Gregorian native controls.
  • A mutation that disables FR15 fails the presentation tests.
  • Real browsers against Storybook with a desktop viewport: Chromium 149 and Firefox 151 with native Temporal, with the polyfill, and with no Temporal; WebKit (Safari 26.5) with the polyfill and with no Temporal.

Screenshots

Chromium 149 with native Temporal unless noted.

State Screenshot
Desktop, Persian: an explicit presentation="native" uses the Astryx popover Desktop, Persian: an explicit presentation="native" uses the Astryx popover
No Temporal: Persian falls back to Gregorian, so the native picker is allowed again No Temporal: Persian falls back to Gregorian, so the native picker is allowed again

Scope

  • One capability is added.
  • Unrelated fixes, cleanup, and policy changes were removed or split.
  • Consumer docs, focused tests, and migration evidence ship with the feature.
  • Public text and artifacts contain no internal Meta context.

Testing

  • pnpm exec vitest run --maxWorkers=4 over the presentation and no-Temporal tests, packages/core/src/i18n, docPropLiterals.test.ts and the CLI core prop docs test, after the restack onto current main (with Lab's Schedule): 16 files, 218 tests passed. CI runs the full suites.
  • CLI docs tests (golden reads, core prop docs, core doc quality, core doc types) and 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-043

  • R1 narration: the FR1, FR2 and FR3 edits are present tense. The existing Intent still opens with "currently has two answers"; left as is, to keep this amendment minimal.
  • R2 research: none.
  • R3 evidence: the FR2 verification row says "eligibility fallback". No change references.
  • R4 rejected alternatives: none added.
  • R5 change references: none.
  • R6 open questions: none.

component:DateInput

  • R1 narration: FR21, ORD1 and the AST-013 exception are present tense. The touch-and-native gap is replaced by a narrower present-tense gap: the bottom sheet shows Gregorian dates. The Compatibility/readiness row keeps the sheet wheels' markup and time-order key (FR17) sentences and changes only "the calendar on the touch and native surfaces" to "the calendar on the touch surface".
  • R2 research: none.
  • R3 evidence: the FR21 basis and verification cite tests and real-browser runs. The existing (#5074) is part of a quoted test title.
  • R4 rejected alternatives: none.
  • R5 change references: only that quoted test title.
  • R6 open questions: none.

component:DateTimeInput

  • R1 narration: FR12 and ORD1 are present tense. The touch-and-native gap is replaced by a gap for the Gregorian Date panel of the bottom sheet. The Public contract row says the date segment and its popover show the calendar, matching that gap.
  • R2 research: none.
  • R3 evidence: tests only.
  • R4 rejected alternatives: none.
  • R5 change references: none.
  • R6 open questions: none.

component:InternationalizationProvider

  • R1 narration: the FR10 edit is present tense and names the surfaces that stay Gregorian.
  • R2 research: none.
  • R3 evidence: none added.
  • R4 rejected alternatives: none.
  • R5 change references: none.
  • R6 open questions: none.

Part #9794: feat(DateInput, DateTimeInput): the bottom sheet shows months of the calendar

This implements spec:AST-111 (approved in #9605) FR16 for DateInput and DateTimeInput.

User need

After #9793, a phone user in a non-Gregorian calendar gets the Astryx bottom sheet, but it still shows Gregorian months, a 12-month wheel, and Gregorian years. A Hebrew user can't pick Adar I, an Ethiopic user can't reach Pagume, and a Japanese user sees no era.

Problem and solution fit

  • Scroller panes are calendar months, with calendar labels, day names and locale digits, in fixed six-row panes, including the 5–6 day Ethiopic and Coptic thirteenth month (monthGeometry, MonthScroller).
  • The month wheel lists the months of the selected calendar year, with leap months by name. A year change keeps the month or moves to its common counterpart (Adar I → Adar) (MonthYearWheels).
  • Year labels carry the era (令和8, 1405 AP). As on iOS, a year that an era change splits takes its label and the heading's era from the date the wheels show: 2019 reads 平成31 with January selected and 令和元 with July, and January 3, 1989 heads 昭和64年1月.
  • The closed sheet field writes the date in the calendar, with its era, in DateInput and in DateTimeInput's sheet date segment, and the sheet remounts when the calendar changes, since month indexes depend on it (TouchDateField, TouchDateTimeField).
  • Calendar-system utility: months between two months, the calendar month at a year and month position, months of a calendar year, month and year labels, and era-change detection. The month model reads year and month numbers with main's calendarYearMonthOf, and calendarMonthOfYear builds on main's calendarMonthFromYearMonth for calendars that are not Gregorian-aligned. Gregorian-aligned calendars keep Gregorian year numbers inside the sheet's month model.
  • Day grids: MonthScroller lays out each pane with the public useCalendarDays, passing the year and month numbers of its calendar month, since feat(Calendar): useCalendarDays and useCalendarNavigation take an optional calendar #10007 folded the internal useCalendarMonthDays into it.
  • Values stay Gregorian ISO (FR3). Buddhist, Minguo and Japanese sheets work without Temporal.
  • A -u-ca- keyword in the provider locale does not select the calendar, so such a field keeps the Gregorian sheet; calendar on the component or the provider selects one.
  • The records drop the Gregorian-bottom-sheet gap.

Current specification

  • spec:AST-111 FR16 and FR3 (approved in spec(AST-111): date components use the calendar the application chooses #9605).
  • Projected into component:DateInput FR21 and component:DateTimeInput FR12. The sheet's weekday row follows main's DateInput FR19 (Calendar's weekday names). FR21 also says that in a month an era change splits, the heading follows the kept day while the pane's grid name keeps the era of the month's middle day.
  • component:InternationalizationProvider FR10 and its Calendar row, and architecture:internationalization INV10, now say DateInput and DateTimeInput follow the calendar on every surface; only DateRangeInput stays Gregorian. The provider's docs and JSDoc say the same and keep main's statement that Timestamp, PowerSearch, and Lab's Schedule write their dates in the calendar.

Public delta and caller burden

  • Behavior: under a non-Gregorian calendar, the bottom sheet shows that calendar's months, wheels and era years.
  • The bottom sheet's day numbers keep the locale digits they already use (unchanged).
  • No change for gregory/iso8601. No new props or types. Caller decisions: none.

Design and alternatives

  • The touch surfaces index months through a per-calendar month model. Gregorian-aligned calendars keep year * 12 + month, so existing behavior is unchanged. Other calendars count months from a fixed month with Temporal.
  • Labels come from Intl through the shared calendar helpers.

Evidence

  • Touch calendar tests:
    • Persian, Hebrew leap/common, and Ethiopic Pagume panes;
    • wheel month counts (13 vs 12);
    • Adar I → Adar on a year change;
    • Japanese and Persian era labels, the 2019 and 1989 era-change years, and the split-month heading;
    • month-model round trips across seven calendars;
    • the sheet field text and DateTimeInput's date segment in the calendar.
  • Calendar-system tests for formatCalendarYearLabel, the era-change years behind calendarYearSpansEras, and the kept-day formatCalendarMonthLabel cases.
  • No-Temporal tests: Buddhist and Japanese bottom sheets still show their years and eras.
  • Real browsers against Storybook with a mobile viewport and a coarse pointer:
Browser Native Temporal Polyfill No Temporal
Chromium 149 pass pass pass (Gregorian fallback)
Firefox 151 pass pass pass
WebKit (Safari 26.5) n/a (no Temporal) pass pass

Screenshots

Chromium 149 with native Temporal unless noted. Phone shots use a mobile viewport with touch and a coarse pointer.

State Screenshot
Phone, Persian: the bottom sheet shows Aban 1405 in Persian digits Phone, Persian: the bottom sheet shows Aban 1405 in Persian digits
Phone, Hebrew 5784 (leap year): the month wheel lists Adar I and Adar II Phone, Hebrew 5784 (leap year): the month wheel lists Adar I and Adar II
Phone, Hebrew common year: one Adar Phone, Hebrew common year: one Adar
Phone, Ethiopic: the five-day Pagume in a fixed six-row pane Phone, Ethiopic: the five-day Pagume in a fixed six-row pane
Phone, Japanese: year wheel with eras Phone, Japanese: year wheel with eras
Phone, Japanese 2019 with January selected: the row reads 平成31 (Heisei 31) Phone, Japanese 2019 with January selected: the row reads 平成31 (Heisei 31)
Phone, Japanese 2019 with July selected: the row reads 令和元 (Reiwa 1) Phone, Japanese 2019 with July selected: the row reads 令和元 (Reiwa 1)
Phone, DateTimeInput in Persian Phone, DateTimeInput in Persian
WebKit (Safari 26.5) with the polyfill: Persian bottom sheet WebKit (Safari 26.5) with the polyfill: Persian bottom sheet
Firefox 151: Hebrew leap-year wheel Firefox 151: Hebrew leap-year wheel

Scope

  • One capability is added.
  • Unrelated fixes, cleanup, and policy changes were removed or split.
  • Consumer docs, focused tests, and migration evidence ship with the feature.
  • Public text and artifacts contain no internal Meta context.

Testing

  • pnpm exec vitest run --maxWorkers=4 over the MonthScroller, DateInput touch, calendar-presentation and no-Temporal tests and calendarSystem.test.ts, with packages/core/src/i18n, docPropLiterals.test.ts and the CLI core prop docs test, after the restack onto current main (with Lab's Schedule): 20 files, 324 tests passed. CI runs the full suites.
  • CLI docs tests (golden reads, core prop docs, core doc quality, core doc types) and 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-native-fallback: 1,553 authored lines.
  • Playwright against Storybook stories core-dateinput--calendar-system-presentations and core-datetimeinput--calendar-systems. The coarse pointer is isMobile + hasTouch; Firefox uses the ui.primaryPointerCapabilities pref.

Writing rubric results

component:DateInput

  • R1 narration: FR21 is present tense and now states the bottom sheet's months, wheels and era labels, and which era a split month's heading and grid name show. The Gregorian-bottom-sheet gap and its Current-state bullet were removed, because the behavior now ships. The Compatibility/readiness row drops the touch-surface calendar entry and keeps the sheet wheels' markup and time-order key (FR17) sentences.
  • R2 research: none.
  • R3 evidence: the FR21 verification cites the touch calendar tests, calendar-system cases and real-browser runs.
  • R4 rejected alternatives: none.
  • R5 change references: none added.
  • R6 open questions: none.

component:DateTimeInput

  • R1 narration: FR12 is present tense and states that the Date panel follows component:DateInput FR21. The Gregorian Date-panel gap was removed. The FR12 verification row keeps a missing warning for an explicit native among its failures and adds a Date panel in another calendar.
  • R2 research: none.
  • R3 evidence: tests only.
  • R4 rejected alternatives: none.
  • R5 change references: none.
  • R6 open questions: none.

architecture:internationalization

  • R1 narration: INV10 is present tense and names DateRangeInput as the one date input that stays Gregorian.
  • R2 research: none.
  • R3 evidence: none changed.
  • R4 rejected alternatives: none.
  • R5 change references: none.
  • R6 open questions: none.

component:InternationalizationProvider

  • R1 narration: FR10 and the Calendar row are present tense and name DateRangeInput as the one component that stays Gregorian.
  • R2 research: none.
  • R3 evidence: none added.
  • R4 rejected alternatives: none.
  • R5 change references: none.
  • R6 open questions: none.

Part #9653: feat(DateRangeInput): show the range in the calendar

This implements spec:AST-111 (approved in #9605) FR17 for DateRangeInput, with FR3 and FR5. The native-fallback (FR15) and bottom-sheet (FR16) parts that this PR used to carry are now the two PRs below it.

User need

Under a non-Gregorian provider, DateRangeInput is the last date component that still shows Gregorian text: a Persian booking form shows "Oct 30 – Nov 2" in its trigger while every other date reads in Persian. People can't read or pick a range in the application's calendar.

Problem and solution fit

  • FR17: DateRangeInput takes calendar, defaulting to the provider's calendar, else gregory. A -u-ca- keyword in the provider locale does not select the calendar. Its trigger text, the trigger's accessible name, and its popover Calendar use it; the trigger shows the year when either end falls outside the current calendar year. It has no typed entry.
  • The trigger's same-year check reads calendar years with main's calendarYearMonthOf, which takes a calendar month.
  • Values, min, max, presets and span bounds stay Gregorian ISO (FR3). Without Temporal, calendars that need it fall back to Gregorian and warn once in development (FR5).
  • Supporting changes: tests, a story, the doc, the records, PowerSearch's record and docs, and the API report. feat(Calendar): show the months of the selected calendar system #9622's Calendar test now expects DateRangeInput's popover in the calendar instead of Gregorian.

Current specification

  • spec:AST-111 FR17, FR3 and FR5 (approved in spec(AST-111): date components use the calendar the application chooses #9605).
  • Projected into component:DateRangeInput FR6, with the spec:AST-013 FR12 exception matching DateInput's.
  • component:Calendar, component:InternationalizationProvider and architecture:internationalization INV10 now list DateRangeInput among the components that pass or follow the calendar. The provider's docs and JSDoc list it too and keep main's statement that Timestamp, PowerSearch, and Lab's Schedule write their dates in the calendar.
  • component:PowerSearch's Calendar line drops its implementation-gap note, and PowerSearch's timezoneID docs in English, Chinese and dense form drop their editor note. A date_range editor is a DateRangeInput, so with this PR every PowerSearch date editor follows the provider's calendar, as the DateInput editor does from feat(DateInput, DateTimeInput, DateRangeInput): type, pick and show dates in the active calendar #9643.

Public delta and caller burden

  • New: DateRangeInput calendar?: CalendarSystem, defaulting to the provider's calendar, else 'gregory' (API report row added).
  • No change for gregory/iso8601.
<InternationalizationProvider locale="fa-IR" calendar="persian">
  <DateRangeInput label="Stay" value={range} onChange={setRange} /> {/* "۸ آبان – ۱۱ آبان" */}
</InternationalizationProvider>

Caller decisions: none. calendar is optional.

Design and alternatives

  • DateRangeInput reuses the calendar-system formatting and the Calendar calendar prop; it adds no new model.

Evidence

  • DateRangeInput tests: Persian trigger text and the trigger's accessible name (Stay: Aban 8 – Aban 11), the provider's calendar, a range across Nowruz, the popover calendar with Gregorian ISO onChange, Buddhist years, Gregorian text by default, and the no-Temporal fallback.
  • Real browsers against Storybook, desktop and mobile viewports: Chromium 149 and Firefox 151 with native Temporal, with the polyfill, and with no Temporal; WebKit (Safari 26.5) with the polyfill and with no Temporal.

Screenshots

Chromium 149 with native Temporal.

State Screenshot
Desktop, DateRangeInput trigger in Persian Desktop, DateRangeInput trigger in Persian
Desktop, DateRangeInput popover in Persian Desktop, DateRangeInput popover in Persian
Phone, DateRangeInput trigger in Persian Phone, DateRangeInput trigger in Persian

Scope

  • One capability is added.
  • Unrelated fixes, cleanup, and policy changes were removed or split.
  • Consumer docs, focused tests, and migration evidence ship with the feature.
  • Public text and artifacts contain no internal Meta context.

Testing

  • pnpm exec vitest run --maxWorkers=4 over DateRangeInput.calendar.test.tsx, Calendar.calendarSystems.test.tsx, packages/core/src/i18n, docPropLiterals.test.ts and the CLI core prop docs test, after the restack onto current main (with Lab's Schedule): 16 files, 164 tests passed. CI runs the full suites.
  • CLI docs tests (golden reads, core prop docs, core doc quality, core doc types) and docPropLiterals.test.ts: 5 files, 38 tests pass.
  • After the PowerSearch record and docs change: the PowerSearch tests, docPropLiterals.test.ts, and the CLI core prop docs and golden reads tests: 18 files, 570 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-bottom-sheet: 484 authored lines.
  • Playwright against Storybook story core-daterangeinput--calendar-systems.

Writing rubric results

component:DateRangeInput

  • R1 narration: Intent, the compatibility line, the calendar concept, FR6, the Calendar state row, and the AST-013 FR12 exception are present tense. FR6 names the trigger's accessible name, and its verification row names the test that asserts it.
  • R2 research: none.
  • R3 evidence: FR3's basis cited a pull request; it now reads "consumer demand for preset theming".
  • R4 rejected alternatives: none.
  • R5 change references: that one, replaced.
  • R6 open questions: OQ1 is unanswered and unchanged.

component:Calendar

  • R1 narration: the relationship bullet now states that all three inputs pass their calendar.
  • R2 research: none.
  • R3 evidence: unchanged. The existing (#2715) is part of a quoted test title.
  • R4 rejected alternatives: none.
  • R5 change references: only that quoted test title.
  • R6 open questions: unchanged.

architecture:internationalization

  • R1 narration: INV10 says DateInput, DateRangeInput and DateTimeInput follow the calendar as Calendar does, in the present tense.
  • R2 research: none.
  • R3 evidence: none changed.
  • R4 rejected alternatives: none.
  • R5 change references: none.
  • R6 open questions: none.

component:InternationalizationProvider

  • R1 narration: FR10 lists DateRangeInput among the components that follow the calendar.
  • R2 research: none.
  • R3 evidence: none changed.
  • R4 rejected alternatives: none.
  • R5 change references: none.
  • R6 open questions: none.

component:PowerSearch

  • R1 narration: the Calendar line states that date values follow the provider's calendar, with no implementation-gap note.
  • R2 research: none.
  • R3 evidence: none changed.
  • R4 rejected alternatives: none.
  • R5 change references: none.
  • R6 open questions: none.

Part #9837: refactor(DateInput, DateTimeInput): share typed entry in useTypedDateField

Maintainer impact

DateInput and DateTimeInput each kept a copy of the same typed-entry logic: the typed text, the committed rejection, the date that typing last reported, the commit on Enter or blur, and the rejection status and alert. A fix to typed entry had to land twice, and the two copies could drift.

Intended invariant

No behavior change. Typing, commits, onChange reports, rejection messages, the field status, the alert, and the format hint stay as they are in both components.

Change

  • useTypedDateField in packages/core/src/DateInput/useTypedDate.ts now owns the typed text, the committed rejection, the last reported date, the commit on Enter or blur, the reset when a value comes from outside, the shown text and format hint, the shown status, and the alert message. It builds on useTypedDate.
  • DateInput and DateTimeInput call the hook and keep only what differs between them: how a date is reported (DateTimeInput combines it with the time), how emptied text clears the value, whether the shown status announces itself (an InputGroup DateInput does not), and the existing difference on commit in a disabled or busy field (DateInput drops the typed text; DateTimeInput reads it).
  • The hook is internal. It is not exported from the package entry point.
  • component:DateInput now links spec:AST-085 FR1 and FR2 in system_specs, because the source comments that cited them moved out of DateInput.tsx. No requirement text changes.
  • Two comments that restated the code are removed: the one above DateInput's fireChange, and the narration in DateTimeInput's status-icon comment, which keeps only its reason.
  • A [chore] changeset records the internal change.

Evidence

  • Failure before the change: not applicable; no behavior changes.
  • Success after the change: the existing tests pass with no test edits.
  • Product/runtime behavior verified unchanged: every DateInput and DateTimeInput test passes (932 tests; see Testing).
  • CI impact: none; no workflow or CI script changes.

Scope

  • No intended public API, product behavior, visual direction, or policy change.
  • Product changes discovered during the work were removed or split.
  • Public text and artifacts contain no internal Meta context.

Testing

  • pnpm exec vitest run --maxWorkers=2 over every Vitest file in packages/core/src/DateInput and packages/core/src/DateTimeInput, plus docPropLiterals.test.ts: 22 files, 932 tests passed.
  • pnpm exec tsc --noEmit -p packages/core: passes.
  • eslint and prettier --check on the changed files: clean.
  • pnpm check:knowledge and pnpm check:changesets: pass.
  • node scripts/pre-review.mjs --base nynexman4464/feat/calendar-presentations: 724 authored lines.

Writing rubric results

Record: component:DateInput (two system_specs entries, spec:AST-085/FR1 and spec:AST-085/FR2).

  • R1 narration: none; no prose changes.
  • R2 research: none.
  • R3 evidence: none added.
  • R4 rejected alternatives: none.
  • R5 change references: none added.
  • R6 open questions: none.

@vercel

vercel Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Nov 5, 2026 4:48am UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 2, 2026
@astracat-bot

astracat-bot Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
❓ Needs maintainer input (for maintainers only) Nov 5, 2026, 4:49 AM UTC

@astracat-bot astracat-bot Bot 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.

This pull request needs an engineering owner's decision before it can be approved. The new calendar prop and calendar typing for DateInput and DateTimeInput implement spec:AST-111, which is not on main, where the internationalization architecture's INV10 still keeps date parsing Gregorian. An engineering owner must approve that direction, along with the new DateInput FR16/AR9, DateTimeInput FR10/AR5 and Temporal exceptions: land AST-111 and the INV10 rewrite first, or comment /approve-spec d1ab11e46fec54626a2a133b92747e6b19faab1a here (the author may do this as an engineering owner). Whatever the decision, these need fixing:

  • Incomplete text such as Nov or 11/2/202 is dropped on Enter or blur with no alert; announce it as the unreadable rejection.
  • Nonexistent and out-of-range errors are announced twice, by the field's own alert and by the field status.
  • DateTimeInput repeats DateInput's new rejection, focus and commit logic; move it into useTypedDate.
  • Two existing cases in no-raw-intl-locale.test.mjs are overwritten by the new keys; close each object before the new case.
  • calendar-systems-core.md says both fields pick dates in the calendar, but the bottom-sheet and native surfaces stay Gregorian.
  • At about 3,600 authored lines, the change should be split into the parser, the calendar wiring and the Gregorian typing fix.

[Automated review]

Comment on lines +84 to +90
if (
(result.kind === 'nonexistent' || result.kind === 'outOfRange') &&
(result.isComplete || isCommitted)
) {
return result.kind;
}
return null;

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.

An incomplete result never becomes an error here, and the commit paths then revert it silently. Nov, 12/0 or 11/2/202 plus Enter or blur drops the text with no alert or aria-invalid; the base announced "Invalid date" for Nov and 12/0. Treat incomplete as unreadable when isCommitted is true.

*/}
<VisuallyHidden as="div" role="alert" aria-live="assertive">
{!isInputValid ? t('@astryx.dateInput.invalidDate') : ''}
{typedErrorMessage ?? ''}

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.

When the rejection is also shown as fieldStatus, FieldStatus already announces it through useAnnounce, so the nonexistent and out-of-range messages are announced twice (two role="alert" regions with the same text in Chromium). Keep only unreadable messages in this region.

: null;
// A readable date that cannot commit stays in the field, so its reason is
// shown as well as announced.
const fieldStatus: InputStatus | undefined =

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.

This block, the focus/hint state and the complete-only change and kept-rejection commit repeat DateInput.tsx line for line. Moving them into useTypedDate gives both fields one path, so a fix such as the incomplete-text announcement lands in both.

{
code: `new Intl.NumberFormat(locale, {useGrouping: false}).format(day);`,
filename: CALENDAR_SYSTEM_INFRA_FILE,
code: `new Intl.DateTimeFormat(locale, {calendar, timeZone: 'UTC'}).formatToParts(ms);`,

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.

This code/filename pair lands inside the previous object (no },{ before it), so it overwrites the calendar-system case new Intl.NumberFormat(locale, {useGrouping: false}).format(day);. The suite grows 107 to 111 for six new cases.

code: `const {NumberFormat} = Intl;`,
filename: CALENDAR_SYSTEM_INFRA_FILE,
errors: [rawIntlReference],
code: `new Intl.DateTimeFormat(undefined, {calendar: 'persian'});`,

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.

Same here: this overwrites the invalid case const {NumberFormat} = Intl; for the calendar-system file. Close the object above before this case.

Comment thread .changeset/calendar-systems-core.md Outdated
---

[feat] Calendar shows dates in other calendar systems. `InternationalizationProvider` and `Calendar` take a `calendar` prop (`CalendarSystem`, exported from `@astryxdesign/core/i18n`), such as `'persian'`, `'hebrew'`, `'islamic-umalqura'`, or `'buddhist'`; a `-u-ca-` keyword in the provider locale, such as `th-TH-u-ca-buddhist`, selects one too. A locale alone never changes the calendar, so `fa-IR` keeps Gregorian dates until you set `calendar="persian"`. Values do not change: `value`, `min`, `max`, `focusDate`, and every callback stay Gregorian ISO dates. `DateInput`, `DateRangeInput`, and `DateTimeInput`, including their popover calendars, keep showing Gregorian dates. In the selected calendar, the grid shows that calendar's months, including leap months such as Adar I and Adar II and the five- or six-day thirteenth month of the Ethiopic and Coptic calendars. Its heading, day names, and announcements use the calendar; Previous, Next, PageUp, and PageDown move one calendar month; and Shift+PageUp and Shift+PageDown move one calendar year to the same month. Day numbers use the locale's digits, and week numbers stay ISO 8601. The Gregorian-aligned calendars (`gregory`, `iso8601`, `buddhist`, `roc`, `japanese`) work everywhere. The others need `Temporal`; where the runtime lacks it, such as Safari or Node.js 24, load a polyfill like `temporal-polyfill/full/global` on the server and in the browser, or those calendars show Gregorian dates and warn once in development. A server-rendered app loads `Temporal` on the server too, since a server without it renders Gregorian markup.
[feat] Calendar shows dates in other calendar systems. `InternationalizationProvider` and `Calendar` take a `calendar` prop (`CalendarSystem`, exported from `@astryxdesign/core/i18n`), such as `'persian'`, `'hebrew'`, `'islamic-umalqura'`, or `'buddhist'`; a `-u-ca-` keyword in the provider locale, such as `th-TH-u-ca-buddhist`, selects one too. A locale alone never changes the calendar, so `fa-IR` keeps Gregorian dates until you set `calendar="persian"`. Values do not change: `value`, `min`, `max`, `focusDate`, and every callback stay Gregorian ISO dates. `DateInput` and `DateTimeInput` read, write, and pick dates in the same calendar; `DateRangeInput`, including its popover calendar, keeps showing Gregorian dates. In the selected calendar, the grid shows that calendar's months, including leap months such as Adar I and Adar II and the five- or six-day thirteenth month of the Ethiopic and Coptic calendars. Its heading, day names, and announcements use the calendar; Previous, Next, PageUp, and PageDown move one calendar month; and Shift+PageUp and Shift+PageDown move one calendar year to the same month. Day numbers use the locale's digits, and week numbers stay ISO 8601. The Gregorian-aligned calendars (`gregory`, `iso8601`, `buddhist`, `roc`, `japanese`) work everywhere. The others need `Temporal`; where the runtime lacks it, such as Safari or Node.js 24, load a polyfill like `temporal-polyfill/full/global` on the server and in the browser, or those calendars show Gregorian dates and warn once in development. A server-rendered app loads `Temporal` on the server too, since a server without it renders Gregorian markup.

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.

"DateInput and DateTimeInput read, write, and pick dates in the same calendar" holds only for the popover field; the bottom-sheet and native surfaces (the default on touch) stay Gregorian. Suggested: "... in the same calendar in their popover field; their bottom-sheet and native surfaces, and DateRangeInput, keep Gregorian dates."

@astracat-bot astracat-bot Bot 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.

This pull request needs an engineering owner's decision before it can be approved. The new calendar prop and calendar-aware typing for DateInput and DateTimeInput follow draft spec:AST-111, which is not on main, while main's architecture:internationalization INV10 still keeps date parsing Gregorian. An engineering owner can settle the calendar prop, typed and committed text in the resolved calendar, and the Gregorian typing changes by landing AST-111 and the INV10 rewrite on main, or by commenting /approve-spec 90a16cdd9f970ce895235ae4fd8a75ef2a17d9e3 here; the author may do this as an engineering owner.

These need fixing either way:

  • Typing a day the month lacks in year-first text reports a different date first: 1404/12/30 in a Persian field fires onChange('2026-02-22') at 1404/12/3, and 2026-02-30 in sv-SE fires 2026-02-03 (calendarDateParser.ts:1115).
  • Incomplete text such as Nov, 12/0 or 11/2/202 now reverts on Enter or blur with no alert and no aria-invalid, which DateInput AR3 requires.
  • Each nonexistent or out-of-range error is announced twice, once by FieldStatus and once by the field's own live region.
  • DateTimeInput repeats DateInput's new typed-entry state and commit logic instead of keeping it in useTypedDate.
  • The new DateInput FR16 and DateTimeInput FR10 reuse IDs that main already gives to the Enter-and-form-submit requirement.
  • Two new lint-rule test cases are written into existing objects and overwrite two calendar-system cases (no-raw-intl-locale.test.mjs:154-159 and :310-317).
  • The base changeset says both fields "read, write, and pick dates in the same calendar", but their bottom-sheet and native surfaces stay Gregorian.
  • At 3654 authored lines, the parser, the calendar wiring and the Gregorian completeness fix should be split into separate pull requests.

[Automated review]

Comment on lines +1115 to +1116
const length = date == null ? 31 : daysInMonth(lex.calendar, date);
return value * 10 > length;

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.

A single-digit day closes against this month's real length, so 1404/12/3 in a fa-IR Persian field (and 2026-02-3 in sv-SE) counts as complete and fires onChange for the 3rd before the person types the 0 of a 30th the month does not have. Comparing against the calendar's longest month (31) would leave 3 open until another digit, Enter or blur; a one-key-at-a-time test for 1404/12/30 would cover it.

| FR13 | A bottom-sheet picker wheel that comes to rest on a disabled row (outside `min`/`max`) MUST continue to the nearest enabled row, a tie going toward the committed row, and select it there. A wheel resting on its committed row MUST NOT select or commit, even when that row is outside the bounds, so opening a bounded sheet never changes an untouched value: a committed value outside the bounds stays, and an empty field stays empty. This holds for every wheel in the DateInput, TimeInput, and DateTimeInput sheets. Implementation gap: a wheel that rests on a disabled row returns to its committed row instead of continuing to the nearest enabled row. | DEC-1; UIDatePicker on the iOS 26.2 simulator; current source |
| FR14 | A shown bottom-sheet picker wheel whose value changes from outside, as when a bound clamps the time after another wheel turned, MUST turn onto the new row rather than jump to it. Implementation gap: a shown wheel jumps to a value changed from outside. | UIDatePicker on the iOS 26.2 simulator; current source |
| FR15 | Under a coarse primary pointer, a sheet wheel's pan takes a trackpad's two-finger scroll, as `spec:AST-094` FR43 allows a record to grant: the rows follow the fingers, coast on at the lift with the fingers' last speed, and rest on a row by FR13. A mouse-wheel notch turns the wheel one row, as an arrow key does, with no coast. A ctrl-scroll stays the page's zoom (`spec:AST-094` FR43). Implementation gap: the wheel is the browser's scroll-snap column for both inputs, so a trackpad's momentum runs at the browser's rate and a mouse-wheel notch moves the column by the browser's scroll step, several rows. | `spec:AST-094` FR43; current source |
| FR16 | The pointer field reads and writes typed dates in the resolved calendar (`spec:AST-111` FR2), and its Calendar shows that calendar. It reads the dates `Intl.DateTimeFormat` writes for the locale and calendar, in any Unicode decimal digits and with month and era names of the locale and English; in the Gregorian calendar, text that matches none of these forms still commits on Enter or blur when `parseDateInput` reads it (`spec:AST-111` FR9). A typed year is a year of the calendar (`spec:AST-111` FR10). It rejects a date the calendar does not have and never adjusts it; a typed date outside `min`, `max`, or `dateConstraints` shows and announces an out-of-range error that writes the bounds in the calendar, and Enter or blur keeps both kinds of rejected text so the person can correct it, while unreadable text reverts (`spec:AST-111` FR11). While a person types, `onChange` fires only for complete input, at most once for each distinct value; a two-digit year and input without a year commit on Enter or blur, in every calendar including Gregorian (`spec:AST-111` FR12). `date`, `date_long`, and `date_weekday` write the committed text in the calendar and read back as the same date; `system_date` stays Gregorian ISO and the field reads ISO input with it (`spec:AST-111` FR13). Text from a custom `format` function that the field cannot read back cannot be re-committed after an edit (`spec:AST-111` FR14). Values stay Gregorian ISO dates (`spec:AST-111` FR3). Implementation gap: the bottom-sheet and native surfaces show Gregorian dates for every calendar (`spec:AST-111` FR15, FR16). | `spec:AST-111` FR3, FR9–FR14; current source; parser, round-trip, and calendar typed-entry tests |

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.

On main, DateInput FR16 already states the Enter-and-form-submit requirement (and DateTimeInput FR10 the same for its date segment). These rows, and the component:DateInput FR16 reference in Calendar.spec.md, need the next free IDs when this retargets to main.

@astracat-bot astracat-bot Bot 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.

This pull request needs an engineering owner's decision before it can be approved. The new calendar prop and calendar-aware typing for DateInput and DateTimeInput follow draft spec:AST-111, which is not on main, while main's architecture:internationalization INV10 still keeps date parsing Gregorian. An engineering owner can settle the calendar prop, typed and committed text in the resolved calendar, and the Gregorian typing changes by landing AST-111 and the INV10 rewrite on main, or by commenting /approve-spec 79e1235d24cb159fe1b1f018e071b438914cd6e8 here; the author may do this as an engineering owner.

These need fixing either way:

  • Typing a day the month lacks in year-first text reports a different date first: 1404/12/30 in a Persian field fires onChange('2026-02-22') at 1404/12/3, and 2026-02-30 in sv-SE fires 2026-02-03, because the fields fire on the parser's completeness rule, which closes a single-digit day against the current month's length.
  • Incomplete text such as Nov, 12/0 or 11/2/202 now reverts on Enter or blur with no alert and no aria-invalid, which DateInput AR3 requires.
  • Each nonexistent or out-of-range error is announced twice, once by FieldStatus and once by the field's own live region.
  • DateTimeInput repeats DateInput's new typed-entry state and commit logic instead of keeping it in useTypedDate.
  • The rewritten calendar-systems-core.md sentence and the provider docs say both fields "read, write, and pick dates in the same calendar", but their bottom-sheet and native surfaces stay Gregorian.
  • The new DateInput FR16 and DateTimeInput FR10 reuse IDs that main already gives to the Enter-and-form-submit requirement.

[Automated review]

const parsedISO = plainDateToISO(parsed);
// Report a date only once more typing cannot change it.
const result = typedDate.parse(newValue);
if (result.kind !== 'value' || !result.isComplete) {

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.

This fires as soon as the parser calls the text complete, and #9792's parser closes a single-digit day against the current month's length (calendarDateParser.ts:1114-1116). So 1404/12/3 in a fa-IR Persian field (and 2026-02-3 in sv-SE) fires onChange for the 3rd before the person types the 0 of a 30th the month does not have. Comparing against the calendar's longest month (31) leaves 3 open until another digit, Enter or blur; a one-key-at-a-time test for 1404/12/30 here would cover it.

) {
return result.kind;
}
return null;

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.

An incomplete result never becomes an error here, and both commit paths then revert it silently: Nov, 12/0 or 11/2/202 plus Enter or blur drops the text with no alert or aria-invalid, where the base announced "Invalid date" for Nov. Treat incomplete as unreadable when isCommitted is true.

*/}
<VisuallyHidden as="div" role="alert" aria-live="assertive">
{!isInputValid ? t('@astryx.dateInput.invalidDate') : ''}
{typedErrorMessage ?? ''}

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.

When the rejection is also shown as fieldStatus, FieldStatus already announces it through useAnnounce, so nonexistent and out-of-range messages are spoken twice (two role="alert" regions with the same text in Chromium). Keep only unreadable messages in this region; DateTimeInput.tsx:1888 has the same pair.

: null;
// A readable date that cannot commit stays in the field, so its reason is
// shown as well as announced.
const fieldStatus: InputStatus | undefined =

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.

This block, the pending, focus and hint state, and the complete-only change and kept-rejection commit repeat DateInput.tsx line for line. Moving them into useTypedDate gives both fields one path, so a fix such as the incomplete-text announcement lands in both.

Comment thread .changeset/calendar-systems-core.md Outdated
---

[feat] Calendar shows dates in other calendar systems. `Calendar` takes a `calendar` prop (`CalendarSystem`), such as `'persian'`, `'hebrew'`, `'islamic-umalqura'`, or `'buddhist'`, and otherwise shows the `InternationalizationProvider` calendar. Values do not change: `value`, `min`, `max`, `focusDate`, and every callback stay Gregorian ISO dates. `DateInput`, `DateRangeInput`, and `DateTimeInput`, including their popover calendars, keep showing Gregorian dates. In the selected calendar, the grid shows that calendar's months, including leap months such as Adar I and Adar II and the five- or six-day thirteenth month of the Ethiopic and Coptic calendars. Its heading, day names, and announcements use the calendar; Previous, Next, PageUp, and PageDown move one calendar month; and Shift+PageUp and Shift+PageDown move one calendar year to the same month. Day numbers use the locale's digits, and week numbers stay ISO 8601. The Gregorian-aligned calendars (`gregory`, `iso8601`, `buddhist`, `roc`, `japanese`) work everywhere. The others need `Temporal`; where the runtime lacks it, such as Safari or Node.js 24, load a polyfill like `temporal-polyfill/full/global` on the server and in the browser, or those calendars show Gregorian dates and warn once in development. A server-rendered app loads `Temporal` on the server too, since a server without it renders Gregorian markup.
[feat] Calendar shows dates in other calendar systems. `Calendar` takes a `calendar` prop (`CalendarSystem`), such as `'persian'`, `'hebrew'`, `'islamic-umalqura'`, or `'buddhist'`, and otherwise shows the `InternationalizationProvider` calendar. Values do not change: `value`, `min`, `max`, `focusDate`, and every callback stay Gregorian ISO dates. `DateInput` and `DateTimeInput` read, write, and pick dates in the same calendar; `DateRangeInput`, including its popover calendar, keeps showing Gregorian dates. In the selected calendar, the grid shows that calendar's months, including leap months such as Adar I and Adar II and the five- or six-day thirteenth month of the Ethiopic and Coptic calendars. Its heading, day names, and announcements use the calendar; Previous, Next, PageUp, and PageDown move one calendar month; and Shift+PageUp and Shift+PageDown move one calendar year to the same month. Day numbers use the locale's digits, and week numbers stay ISO 8601. The Gregorian-aligned calendars (`gregory`, `iso8601`, `buddhist`, `roc`, `japanese`) work everywhere. The others need `Temporal`; where the runtime lacks it, such as Safari or Node.js 24, load a polyfill like `temporal-polyfill/full/global` on the server and in the browser, or those calendars show Gregorian dates and warn once in development. A server-rendered app loads `Temporal` on the server too, since a server without it renders Gregorian markup.

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.

"DateInput and DateTimeInput read, write, and pick dates in the same calendar" holds only for the popover field; the bottom-sheet and native surfaces, the default on touch, stay Gregorian. Suggested: "… in the same calendar in their popover field; their bottom-sheet and native surfaces, and DateRangeInput, keep Gregorian dates."

| FR13 | A bottom-sheet picker wheel that comes to rest on a disabled row (outside `min`/`max`) MUST continue to the nearest enabled row, a tie going toward the committed row, and select it there. A wheel resting on its committed row MUST NOT select or commit, even when that row is outside the bounds, so opening a bounded sheet never changes an untouched value: a committed value outside the bounds stays, and an empty field stays empty. This holds for every wheel in the DateInput, TimeInput, and DateTimeInput sheets. Implementation gap: a wheel that rests on a disabled row returns to its committed row instead of continuing to the nearest enabled row. | DEC-1; UIDatePicker on the iOS 26.2 simulator; current source |
| FR14 | A shown bottom-sheet picker wheel whose value changes from outside, as when a bound clamps the time after another wheel turned, MUST turn onto the new row rather than jump to it. Implementation gap: a shown wheel jumps to a value changed from outside. | UIDatePicker on the iOS 26.2 simulator; current source |
| FR15 | Under a coarse primary pointer, a sheet wheel's pan takes a trackpad's two-finger scroll, as `spec:AST-094` FR43 allows a record to grant: the rows follow the fingers, coast on at the lift with the fingers' last speed, and rest on a row by FR13. A mouse-wheel notch turns the wheel one row, as an arrow key does, with no coast. A ctrl-scroll stays the page's zoom (`spec:AST-094` FR43). Implementation gap: the wheel is the browser's scroll-snap column for both inputs, so a trackpad's momentum runs at the browser's rate and a mouse-wheel notch moves the column by the browser's scroll step, several rows. | `spec:AST-094` FR43; current source |
| FR16 | The pointer field reads and writes typed dates in the resolved calendar (`spec:AST-111` FR2), and its Calendar shows that calendar. It reads the dates `Intl.DateTimeFormat` writes for the locale and calendar, in any Unicode decimal digits and with month and era names of the locale and English; in the Gregorian calendar, text that matches none of these forms still commits on Enter or blur when `parseDateInput` reads it (`spec:AST-111` FR9). A typed year is a year of the calendar (`spec:AST-111` FR10). It rejects a date the calendar does not have and never adjusts it; a typed date outside `min`, `max`, or `dateConstraints` shows and announces an out-of-range error that writes the bounds in the calendar, and Enter or blur keeps both kinds of rejected text so the person can correct it, while unreadable text reverts (`spec:AST-111` FR11). While a person types, `onChange` fires only for complete input, at most once for each distinct value; a two-digit year and input without a year commit on Enter or blur, in every calendar including Gregorian (`spec:AST-111` FR12). `date`, `date_long`, and `date_weekday` write the committed text in the calendar and read back as the same date; `system_date` stays Gregorian ISO and the field reads ISO input with it (`spec:AST-111` FR13). Text from a custom `format` function that the field cannot read back cannot be re-committed after an edit (`spec:AST-111` FR14). Values stay Gregorian ISO dates (`spec:AST-111` FR3). Implementation gap: the bottom-sheet and native surfaces show Gregorian dates for every calendar (`spec:AST-111` FR15, FR16). | `spec:AST-111` FR3, FR9–FR14; current source; parser, round-trip, and calendar typed-entry tests |

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.

On main, DateInput FR16 already states the Enter-and-form-submit requirement (and DateTimeInput FR10 the same for its date segment). This row, the DateTimeInput FR10 row and the component:DateInput FR16 reference in Calendar.spec.md need the next free IDs when this rebases onto main.

@astracat-bot astracat-bot Bot 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.

This pull request needs an engineering owner's decision before it can be approved. The new calendar prop and calendar-aware typing for DateInput and DateTimeInput follow draft spec:AST-111, which is not on main, while main's architecture:internationalization INV10 still keeps date parsing Gregorian. An engineering owner can settle the calendar prop, typed and committed text in the resolved calendar, and the Gregorian typing changes by landing AST-111 and the INV10 rewrite on main, or by commenting /approve-spec d3fbd6269c7df93b9ae2d4dc0e6ae7e40f11c2fd here; the author may do this as an engineering owner.

These need fixing either way:

  • Typing a day the month lacks in year-first text reports a different date first: 1404/12/30 in a Persian field fires onChange('2026-02-22') at 1404/12/3, and 2026-02-30 in sv-SE fires 2026-02-03, because the fields fire on the parser's completeness rule, which closes a single-digit day against the current month's length.
  • A controlled caller that keeps its value (it rejects the date, or a changeAction resolves without updating) never gets onChange again when the person retypes the same date, because lastFiredValueRef and lastFiredDateRef are cleared only when value changes.
  • Incomplete text such as Nov, 12/0 or 11/2/202 now reverts on Enter or blur with no alert and no aria-invalid, which DateInput AR3 requires.
  • Each nonexistent or out-of-range error is announced twice, once through the field's status and once by the field's own live region.
  • DateTimeInput repeats DateInput's new typed-entry state and commit logic instead of keeping it in useTypedDate.
  • The rewritten calendar-systems-core.md sentence and the provider docs say both fields "read, write, and pick dates in the same calendar", but their bottom-sheet and native surfaces stay Gregorian.
  • The new DateInput FR16 and DateTimeInput FR10 reuse IDs that main already gives to the Enter-and-form-submit requirement.

[Automated review]

const parsedISO = plainDateToISO(parsed);
// Report a date only once more typing cannot change it.
const result = typedDate.parse(newValue);
if (result.kind !== 'value' || !result.isComplete) {

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.

This fires as soon as the parser calls the text complete, and the parser closes a single-digit day against the current month's length (calendarDateParser.ts:1114-1116). So 1404/12/3 in a fa-IR Persian field fires onChange('2026-02-22') before the final 0 makes the date one Esfand lacks, and 2026-02-3 in sv-SE fires 2026-02-03. Closing a single-digit day only when ten times it exceeds 31 avoids it.

return;
}
const parsedISO = plainDateToISO(result.date);
if (parsedISO !== value && parsedISO !== lastFiredValueRef.current) {

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.

lastFiredValueRef is cleared only when value changes. If the caller keeps its value (it rejects the date, or a changeAction resolves without updating), a retyped 11/2/2026 plus Enter fires nothing and the field reverts; the base fires again. Clearing the ref when the pending text is committed or reverted keeps the once-per-date rule inside one typing session. DateTimeInput.tsx:1127 and :1160 have the same guard.

if (result == null) {
return null;
}
if (result.kind === 'unreadable') {

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.

An incomplete result never becomes an error here, and both commit paths then revert it silently: Nov, 12/0 or 11/2/202 plus Enter or blur drops the text with no alert or aria-invalid, where the base announced "Invalid date" for Nov and 12/0. Treating incomplete as unreadable when committed would keep DateInput AR3's assertive alert.

*/}
<VisuallyHidden as="div" role="alert" aria-live="assertive">
{!isInputValid ? t('@astryx.dateInput.invalidDate') : ''}
{typedErrorMessage ?? ''}

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.

When the rejection is also shown as fieldStatus, Field already announces it through useAnnounce, so nonexistent and out-of-range messages are spoken twice (two assertive regions with the same text in Chromium). Announcing only unreadable here avoids the repeat. DateTimeInput.tsx:1891 is the same.

: null;
// A readable date that cannot commit stays in the field, so its reason is
// shown as well as announced.
const fieldStatus: InputStatus | undefined =

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.

This block, the pending, focus and hint state, and the complete-only change and kept-rejection commit repeat DateInput.tsx line for line. Moving them into useTypedDate gives both fields one path, so a fix such as the two above lands once.

Comment thread .changeset/calendar-systems-core.md Outdated
---

[feat] Calendar shows dates in other calendar systems. `Calendar` takes a `calendar` prop (`CalendarSystem`), such as `'persian'`, `'hebrew'`, `'islamic-umalqura'`, or `'buddhist'`, and otherwise shows the `InternationalizationProvider` calendar. Values do not change: `value`, `min`, `max`, `focusDate`, and every callback stay Gregorian ISO dates. `DateInput`, `DateRangeInput`, and `DateTimeInput`, including their popover calendars, keep showing Gregorian dates. In the selected calendar, the grid shows that calendar's months, including leap months such as Adar I and Adar II and the five- or six-day thirteenth month of the Ethiopic and Coptic calendars. Its heading, day names, and announcements use the calendar; Previous, Next, PageUp, and PageDown move one calendar month; and Shift+PageUp and Shift+PageDown move one calendar year to the same month. Day numbers use the locale's digits, and week numbers stay ISO 8601. The Gregorian-aligned calendars (`gregory`, `iso8601`, `buddhist`, `roc`, `japanese`) work everywhere. The others need `Temporal`; where the runtime lacks it, such as Safari or Node.js 24, load a polyfill like `temporal-polyfill/full/global` on the server and in the browser, or those calendars show Gregorian dates and warn once in development. A server-rendered app loads `Temporal` on the server too, since a server without it renders Gregorian markup.
[feat] Calendar shows dates in other calendar systems. `Calendar` takes a `calendar` prop (`CalendarSystem`), such as `'persian'`, `'hebrew'`, `'islamic-umalqura'`, or `'buddhist'`, and otherwise shows the `InternationalizationProvider` calendar. Values do not change: `value`, `min`, `max`, `focusDate`, and every callback stay Gregorian ISO dates. `DateInput` and `DateTimeInput` read, write, and pick dates in the same calendar; `DateRangeInput`, including its popover calendar, keeps showing Gregorian dates. In the selected calendar, the grid shows that calendar's months, including leap months such as Adar I and Adar II and the five- or six-day thirteenth month of the Ethiopic and Coptic calendars. Its heading, day names, and announcements use the calendar; Previous, Next, PageUp, and PageDown move one calendar month; and Shift+PageUp and Shift+PageDown move one calendar year to the same month. Day numbers use the locale's digits, and week numbers stay ISO 8601. The Gregorian-aligned calendars (`gregory`, `iso8601`, `buddhist`, `roc`, `japanese`) work everywhere. The others need `Temporal`; where the runtime lacks it, such as Safari or Node.js 24, load a polyfill like `temporal-polyfill/full/global` on the server and in the browser, or those calendars show Gregorian dates and warn once in development. A server-rendered app loads `Temporal` on the server too, since a server without it renders Gregorian markup.

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.

"DateInput and DateTimeInput read, write, and pick dates in the same calendar" holds only for the popover field; the bottom-sheet and native surfaces, the default on touch, stay Gregorian. Suggested: "… in the same calendar in their popover field; their bottom-sheet and native surfaces, and DateRangeInput, keep Gregorian dates." The provider docs and record repeat the same claim.

| FR13 | A bottom-sheet picker wheel that comes to rest on a disabled row (outside `min`/`max`) MUST continue to the nearest enabled row, a tie going toward the committed row, and select it there. A wheel resting on its committed row MUST NOT select or commit, even when that row is outside the bounds, so opening a bounded sheet never changes an untouched value: a committed value outside the bounds stays, and an empty field stays empty. This holds for every wheel in the DateInput, TimeInput, and DateTimeInput sheets. Implementation gap: a wheel that rests on a disabled row returns to its committed row instead of continuing to the nearest enabled row. | DEC-1; UIDatePicker on the iOS 26.2 simulator; current source |
| FR14 | A shown bottom-sheet picker wheel whose value changes from outside, as when a bound clamps the time after another wheel turned, MUST turn onto the new row rather than jump to it. Implementation gap: a shown wheel jumps to a value changed from outside. | UIDatePicker on the iOS 26.2 simulator; current source |
| FR15 | Under a coarse primary pointer, a sheet wheel's pan takes a trackpad's two-finger scroll, as `spec:AST-094` FR43 allows a record to grant: the rows follow the fingers, coast on at the lift with the fingers' last speed, and rest on a row by FR13. A mouse-wheel notch turns the wheel one row, as an arrow key does, with no coast. A ctrl-scroll stays the page's zoom (`spec:AST-094` FR43). Implementation gap: the wheel is the browser's scroll-snap column for both inputs, so a trackpad's momentum runs at the browser's rate and a mouse-wheel notch moves the column by the browser's scroll step, several rows. | `spec:AST-094` FR43; current source |
| FR16 | The pointer field reads and writes typed dates in the resolved calendar (`spec:AST-111` FR2), and its Calendar shows that calendar. It reads the dates `Intl.DateTimeFormat` writes for the locale and calendar, in any Unicode decimal digits and with month and era names of the locale and English; in the Gregorian calendar, text that matches none of these forms, or that these forms read as a date the calendar does not have, still commits on Enter or blur when `parseDateInput` reads it, so `13/5/2026` in `en-US` commits as 13 May 2026 (`spec:AST-111` FR9). A typed year is a year of the calendar (`spec:AST-111` FR10). It rejects a date the calendar does not have and never adjusts it; a typed date outside `min`, `max`, or `dateConstraints` shows and announces an out-of-range error that writes the bounds in the calendar, and Enter or blur keeps both kinds of rejected text so the person can correct it, while unreadable text reverts (`spec:AST-111` FR11). While a person types, `onChange` fires only for complete input, at most once for each distinct value; a two-digit year and input without a year commit on Enter or blur, in every calendar including Gregorian (`spec:AST-111` FR12). `date`, `date_long`, and `date_weekday` write the committed text in the calendar and read back as the same date; `system_date` stays Gregorian ISO and the field reads ISO input with it (`spec:AST-111` FR13). Text from a custom `format` function that the field cannot read back cannot be re-committed after an edit (`spec:AST-111` FR14). Values stay Gregorian ISO dates (`spec:AST-111` FR3). Implementation gap: the bottom-sheet and native surfaces show Gregorian dates for every calendar (`spec:AST-111` FR15, FR16). | `spec:AST-111` FR3, FR9–FR14; current source; parser, round-trip, and calendar typed-entry tests |

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.

On main, DateInput FR16 already states the Enter-and-form-submit requirement (and DateTimeInput FR10 the same for its date segment). This row, the DateTimeInput FR10 row and the component:DateInput FR16 reference in Calendar.spec.md need the next free IDs when this rebases onto main.

@astracat-bot astracat-bot Bot 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.

This pull request needs an engineering owner's decision before it can be approved. The new calendar prop and calendar-aware typing for DateInput and DateTimeInput follow draft spec:AST-111, which is not on main, while main's architecture:internationalization INV10 still keeps date parsing Gregorian. An engineering owner can settle the calendar prop, typed and committed text in the resolved calendar, and the Gregorian typing changes by landing AST-111 and the INV10 rewrite on main, or by commenting /approve-spec 2187c77f73ac1b729ae526cc707eb95d28472cd4 here; the author may do this as an engineering owner.

These need fixing either way:

  • Typing a day the month lacks reports a different date first: 1404/12/30 in a Persian field fires onChange('2026-02-22') at 1404/12/3, and 2026-02-30 in sv-SE fires 2026-02-03, because the fields fire on the parser's completeness rule, which closes a single-digit day against the current month's length.
  • A controlled caller that keeps its value (it rejects the date, or a changeAction fails) never gets onChange again when the person retypes the same date, because lastFiredValueRef and lastFiredDateRef are cleared only when value changes.
  • Incomplete text such as 11/2/202 or Nov now stays in the field after Enter or blur with only a hidden "Invalid date" alert and no visible error, so sighted users see text that never committed (DateInput AR3).
  • Each nonexistent or out-of-range error is announced twice, once through the field's error status and once by the field's own alert region.
  • DateTimeInput repeats DateInput's new typed-entry state and commit logic instead of keeping it in useTypedDate.
  • The rewritten calendar-systems-core.md sentence and the provider docs say both fields "read, write, and pick dates in the same calendar", but their bottom-sheet and native surfaces stay Gregorian.
  • The new DateInput FR16 and DateTimeInput FR10 reuse IDs that main already gives to the Enter-and-form-submit requirement.

[Automated review]

const parsedISO = plainDateToISO(parsed);
// Report a date only once more typing cannot change it.
const result = typedDate.parse(newValue);
if (result.kind !== 'value' || !result.isComplete) {

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.

This fires as soon as the parser calls the text complete, and the base parser closes a single-digit day against the current month's length. Typing 1404/12/30 one key at a time in a fa-IR Persian field fires onChange('2026-02-22') at 1404/12/3, and 2026-02-30 in sv-SE fires 2026-02-03. Closing a single-digit day only above the calendar's longest month (31) avoids it.

}
const parsedISO = plainDateToISO(result.date);
if (parsedISO !== value && parsedISO !== lastFiredValueRef.current) {
lastFiredValueRef.current = parsedISO;

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.

lastFiredValueRef is cleared only when value changes. If the caller keeps its value (it rejects the date, or a changeAction fails), retyping the same date and pressing Enter fires nothing. Clearing the ref whenever pending text is committed or reverted keeps the guard to one typing session. DateTimeInput.tsx:1129 has the same issue.

const fieldStatus: InputStatus | undefined =
status ??
(typedError === 'nonexistent' || typedError === 'outOfRange'
? {type: 'error', message: typedErrorMessage ?? undefined}

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.

Incomplete text is now kept on Enter or blur, but only nonexistent and outOfRange become the field status. 11/2/202 then Tab stays in the field with aria-invalid and a hidden "Invalid date" alert, and no visible error, while the value is unchanged. Showing the unreadable message here whenever rejected text is kept would match the other two kinds.

*/}
<VisuallyHidden as="div" role="alert" aria-live="assertive">
{!isInputValid ? t('@astryx.dateInput.invalidDate') : ''}
{typedErrorMessage ?? ''}

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.

When the rejection is also shown as fieldStatus, FieldStatus announces it through useAnnounce, so nonexistent and out-of-range messages are spoken twice (two assertive regions with the same text in Chromium). This region could carry only rejections that no field status shows.

: null;
// A readable date that cannot commit stays in the field, so its reason is
// shown as well as announced.
const fieldStatus: InputStatus | undefined =

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.

This block, the pending, rejection and focus state, the hint condition, and the complete-only change and kept-rejection commit repeat DateInput.tsx line for line. Moving them into useTypedDate gives each field one call, so a fix to one cannot miss the other.

Comment thread .changeset/calendar-systems-core.md Outdated
---

[feat] Calendar shows dates in other calendar systems. `Calendar` takes a `calendar` prop (`CalendarSystem`), such as `'persian'`, `'hebrew'`, `'islamic-umalqura'`, or `'buddhist'`, and otherwise shows the `InternationalizationProvider` calendar. Values do not change: `value`, `min`, `max`, `focusDate`, and every callback stay Gregorian ISO dates. `DateInput`, `DateRangeInput`, and `DateTimeInput`, including their popover calendars, keep showing Gregorian dates. In the selected calendar, the grid shows that calendar's months, including leap months such as Adar I and Adar II and the five- or six-day thirteenth month of the Ethiopic and Coptic calendars. Its heading, day names, and announcements use the calendar; Previous, Next, PageUp, and PageDown move one calendar month; and Shift+PageUp and Shift+PageDown move one calendar year to the same month. Day numbers use the locale's digits, and week numbers stay ISO 8601. The Gregorian-aligned calendars (`gregory`, `iso8601`, `buddhist`, `roc`, `japanese`) work everywhere. The others need `Temporal`; where the runtime lacks it, such as Safari or Node.js 24, load a polyfill like `temporal-polyfill/full/global` on the server and in the browser, or those calendars show Gregorian dates and warn once in development. A server-rendered app loads `Temporal` on the server too, since a server without it renders Gregorian markup.
[feat] Calendar shows dates in other calendar systems. `Calendar` takes a `calendar` prop (`CalendarSystem`), such as `'persian'`, `'hebrew'`, `'islamic-umalqura'`, or `'buddhist'`, and otherwise shows the `InternationalizationProvider` calendar. Values do not change: `value`, `min`, `max`, `focusDate`, and every callback stay Gregorian ISO dates. `DateInput` and `DateTimeInput` read, write, and pick dates in the same calendar; `DateRangeInput`, including its popover calendar, keeps showing Gregorian dates. In the selected calendar, the grid shows that calendar's months, including leap months such as Adar I and Adar II and the five- or six-day thirteenth month of the Ethiopic and Coptic calendars. Its heading, day names, and announcements use the calendar; Previous, Next, PageUp, and PageDown move one calendar month; and Shift+PageUp and Shift+PageDown move one calendar year to the same month. Day numbers use the locale's digits, and week numbers stay ISO 8601. The Gregorian-aligned calendars (`gregory`, `iso8601`, `buddhist`, `roc`, `japanese`) work everywhere. The others need `Temporal`; where the runtime lacks it, such as Safari or Node.js 24, load a polyfill like `temporal-polyfill/full/global` on the server and in the browser, or those calendars show Gregorian dates and warn once in development. A server-rendered app loads `Temporal` on the server too, since a server without it renders Gregorian markup.

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.

"DateInput and DateTimeInput read, write, and pick dates in the same calendar" holds only for the popover field; the bottom-sheet and native surfaces, the default on touch, stay Gregorian, as calendar-typed-entry.md says. The provider docs and record repeat the broader claim.

| FR13 | A bottom-sheet picker wheel that comes to rest on a disabled row (outside `min`/`max`) MUST continue to the nearest enabled row, a tie going toward the committed row, and select it there. A wheel resting on its committed row MUST NOT select or commit, even when that row is outside the bounds, so opening a bounded sheet never changes an untouched value: a committed value outside the bounds stays, and an empty field stays empty. This holds for every wheel in the DateInput, TimeInput, and DateTimeInput sheets. Implementation gap: a wheel that rests on a disabled row returns to its committed row instead of continuing to the nearest enabled row. | DEC-1; UIDatePicker on the iOS 26.2 simulator; current source |
| FR14 | A shown bottom-sheet picker wheel whose value changes from outside, as when a bound clamps the time after another wheel turned, MUST turn onto the new row rather than jump to it. Implementation gap: a shown wheel jumps to a value changed from outside. | UIDatePicker on the iOS 26.2 simulator; current source |
| FR15 | Under a coarse primary pointer, a sheet wheel's pan takes a trackpad's two-finger scroll, as `spec:AST-094` FR43 allows a record to grant: the rows follow the fingers, coast on at the lift with the fingers' last speed, and rest on a row by FR13. A mouse-wheel notch turns the wheel one row, as an arrow key does, with no coast. A ctrl-scroll stays the page's zoom (`spec:AST-094` FR43). Implementation gap: the wheel is the browser's scroll-snap column for both inputs, so a trackpad's momentum runs at the browser's rate and a mouse-wheel notch moves the column by the browser's scroll step, several rows. | `spec:AST-094` FR43; current source |
| FR16 | The pointer field reads and writes typed dates in the resolved calendar (`spec:AST-111` FR2), and its Calendar shows that calendar. It reads the dates `Intl.DateTimeFormat` writes for the locale and calendar, in any Unicode decimal digits and with month and era names of the locale and English; in the Gregorian calendar, text that matches none of these forms, or that these forms read as a date the calendar does not have, still commits on Enter or blur when `parseDateInput` reads it, so `13/5/2026` in `en-US` commits as 13 May 2026 (`spec:AST-111` FR9). A typed year is a year of the calendar (`spec:AST-111` FR10). It rejects a date the calendar does not have and never adjusts it; a typed date outside `min`, `max`, or `dateConstraints` shows and announces an out-of-range error that writes the bounds in the calendar, and Enter or blur keeps both kinds of rejected text so the person can correct it, while unreadable text reverts (`spec:AST-111` FR11). While a person types, `onChange` fires only for complete input, at most once for each distinct value; a two-digit year and input without a year commit on Enter or blur, in every calendar including Gregorian, and a one-digit year is not a date: like other text the field cannot finish, Enter or blur keeps it and announces the unreadable message (`spec:AST-111` FR12, AR3). `date`, `date_long`, and `date_weekday` write the committed text in the calendar and read back as the same date; `system_date` stays Gregorian ISO and the field reads ISO input with it (`spec:AST-111` FR13). Text from a custom `format` function that the field cannot read back cannot be re-committed after an edit (`spec:AST-111` FR14). Values stay Gregorian ISO dates (`spec:AST-111` FR3). Implementation gap: the bottom-sheet and native surfaces show Gregorian dates for every calendar (`spec:AST-111` FR15, FR16). | `spec:AST-111` FR3, FR9–FR14; current source; parser, round-trip, and calendar typed-entry tests |

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.

On main, DateInput FR16 is the Enter-and-form-submit requirement, and DateTimeInput FR10 the same for its date segment. This row and the new DateTimeInput FR10 reuse those IDs, so they need new numbers after the rebase.

@nynexman4464
nynexman4464 force-pushed the nynexman4464/feat/calendar-date-parser branch from 3bfcb3f to 96920a3 Compare November 3, 2026 22:40
@nynexman4464
nynexman4464 force-pushed the nynexman4464/feat/calendar-typed-entry branch from 2187c77 to b3b17f4 Compare November 3, 2026 23:26

@astracat-bot astracat-bot Bot 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.

This pull request needs an engineering owner's decision before it can be approved. The new calendar prop and calendar-aware typing for DateInput and DateTimeInput follow draft spec:AST-111, which is not on main, while main's architecture:internationalization INV10 still keeps date parsing Gregorian. An engineering owner can settle the calendar prop, typed and committed text in the resolved calendar, and the Gregorian typing changes (including two-digit years in day-first locales, which main's DateInput FR6 does not read as dates) by landing AST-111 and the INV10 rewrite on main, or by commenting /approve-spec b3b17f4b6fc5d08c9672954bb2e8a2720859f9c1 here; the author may do this as an engineering owner.

These need fixing either way:

  • apps/storybook/stories/DateInput.stories.tsx imports InternationalizationProvider twice (line 9 and lines 14–17), so Storybook fails to index the file and does not start.
  • When the caller sets status, text kept after a rejected entry shows only the caller's message, so the reason ("This date does not exist…" or the allowed range) is announced but never shown (DateInput AR3).
  • DateTimeInput repeats DateInput's new pending, rejection, status and commit logic instead of keeping it in useTypedDate, so each fix has to be made twice.
  • The new calendar requirement is numbered DateInput FR17, which main already uses for sheet-wheel keyboard behavior, so it needs a new number after the rebase.

The earlier issues with wrong dates while typing, retyped dates, kept incomplete text, double announcements and the changeset wording are fixed on this head.

[Automated review]

Comment on lines +14 to +17
import {
type CalendarSystem,
InternationalizationProvider,
} from '@astryxdesign/core/i18n';

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.

Line 9 already imports InternationalizationProvider, so this second import makes the file fail to parse ("Identifier 'InternationalizationProvider' has already been declared"), and Storybook stops indexing and exits. Importing type CalendarSystem in the line 9 import and deleting this block fixes it.

(typedError !== 'unreadable' || isRejectionCommitted)
? {type: 'error', message: typedErrorMessage}
: undefined;
const fieldStatus = status ?? typedStatus;

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.

With a caller status, kept rejected text shows only the caller's message; "This date does not exist…" or the bounds are announced through the alert but never shown (Storybook WithWarningStatus, 2/30/2026 then Tab). Showing the typed rejection while its text is kept (for example typedStatus ?? status, or both messages) keeps the reason visible. DateTimeInput.tsx:811 has the same line.

});

// --- Date input state ---
const [datePendingInput, setDatePendingInput] = useState<string | null>(null);

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.

This block, the kept-rejection, status and alert derivation, the hint condition, and the complete-only change and kept-rejection commit repeat DateInput.tsx line for line, and the copies already differ (only DateInput's alert checks inputGroup). Moving them into useTypedDate gives each field one call, so a fix such as the caller-status one lands once.

| FR14 | A shown bottom-sheet picker wheel whose value changes from outside, as when a bound clamps the time after another wheel turned, MUST turn onto the new row rather than jump to it. | UIDatePicker on the iOS 26.2 simulator; current source |
| FR15 | Under a coarse primary pointer, a sheet wheel's pan takes a trackpad's two-finger scroll, as `spec:AST-094` FR43 allows a record to grant: the rows follow the fingers, coast on at the lift with the fingers' last speed, and rest on a row by FR13. A mouse-wheel notch turns the wheel one row, as an arrow key does, with no coast. A ctrl-scroll stays the page's zoom (`spec:AST-094` FR43). Implementation gap: the wheel is the browser's scroll-snap column for both inputs, so a trackpad's momentum runs at the browser's rate and a mouse-wheel notch moves the column by the browser's scroll step, several rows. | `spec:AST-094` FR43; current source |
| FR16 | Enter in the pointer field's text input commits typed text that has not been committed and is then held back, so a form never submits the value from before the commit. With no typed text pending, Enter is not prevented, so a form submits as it does from any text field, except on a disabled or busy field, where Enter does nothing (`spec:AST-085` FR2). |
| FR17 | The pointer field reads and writes typed dates in the resolved calendar (`spec:AST-111` FR2), and its Calendar shows that calendar. It reads the dates `Intl.DateTimeFormat` writes for the locale and calendar, in any Unicode decimal digits and with month and era names of the locale and English; in the Gregorian calendar, text that matches none of these forms, or that these forms read as a date the calendar does not have, still commits on Enter or blur when `parseDateInput` reads it, so `13/5/2026` in `en-US` commits as 13 May 2026 (`spec:AST-111` FR9). A typed year is a year of the calendar (`spec:AST-111` FR10). It rejects a date the calendar does not have and never adjusts it; a typed date outside `min`, `max`, or `dateConstraints` shows and announces an out-of-range error that writes the bounds in the calendar, and Enter or blur keeps both kinds of rejected text so the person can correct it, while unreadable text reverts (`spec:AST-111` FR11). While a person types, `onChange` fires only for complete input, at most once for each distinct value in one typing session, and a one-digit day stays open until another digit, Enter, or blur, so a day the month lacks is never reported as another date; a two-digit year and input without a year commit on Enter or blur, in every calendar including Gregorian, and a one-digit year is not a date: like other text the field cannot finish, Enter or blur keeps it and shows the unreadable message as the field status (`spec:AST-111` FR12, AR3). Each rejection is announced once: a shown status announces itself, and the field's alert carries only a rejection that no status shows. `date`, `date_long`, and `date_weekday` write the committed text in the calendar and read back as the same date; `system_date` stays Gregorian ISO and the field reads ISO input with it (`spec:AST-111` FR13). Text from a custom `format` function that the field cannot read back cannot be re-committed after an edit (`spec:AST-111` FR14). Values stay Gregorian ISO dates (`spec:AST-111` FR3). Implementation gap: the bottom-sheet and native surfaces show Gregorian dates for every calendar (`spec:AST-111` FR15, FR16). | `spec:AST-111` FR3, FR9–FR14; current source; parser, round-trip, and calendar typed-entry tests |

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.

On main, DateInput FR17 is the sheet-wheel Arrow/Page/Home/End requirement and FR18 the wheel's selection band. This row, the DateTimeInput FR11 reference and Calendar.spec.md:236 need the next free number after the rebase.

Live region announcing invalid typed input to assistive technology.
The value silently reverts on blur, so without this a screen-reader
user would get no feedback that their entry was rejected (WCAG 3.3.1).
Live region announcing rejected typed input to assistive technology,

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.

Non-blocking (INV29): this region now carries only a rejection that no field status shows. Suggested: "Announces a typed rejection that no field status shows. A shown status announces itself." DateTimeInput.tsx:1903 has the same comment.

… DateInput record

The comments that cited these claims left DateInput.tsx in the shared-hook
move, so the DateInput record now links them. The live-region comments and
the alertMessage doc say which rejections the alert announces.
@nynexman4464
nynexman4464 force-pushed the nynexman4464/feat/calendar-typed-entry branch from e56a372 to 039bd50 Compare November 5, 2026 03:54
@nynexman4464 nynexman4464 changed the title feat(DateInput, DateTimeInput, DateRangeInput): type, pick and show dates in the active calendar feat(DateInput, DateTimeInput): type dates in the active calendar Nov 5, 2026
@nynexman4464

Copy link
Copy Markdown
Contributor Author

/approve-spec 039bd50

@astracat-bot astracat-bot Bot 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.

This pull request is reviewed as part of its stack; see the review on #9842.

@nynexman4464 nynexman4464 changed the title feat(DateInput, DateTimeInput): type dates in the active calendar feat(DateInput, DateTimeInput, DateRangeInput): type, pick and show dates in the active calendar Nov 5, 2026
@nynexman4464

Copy link
Copy Markdown
Contributor Author

/approve-spec e7cb4dd

@astracat-bot astracat-bot Bot 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.

This pull request is reviewed as part of its stack; see the review on #9842.

@nynexman4464

Copy link
Copy Markdown
Contributor Author

/approve-spec 244970c

@astracat-bot astracat-bot Bot 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.

This pull request is reviewed as part of its stack; see the review on #9842.

nynexman4464 added a commit that referenced this pull request Nov 5, 2026
…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.
@nynexman4464

Copy link
Copy Markdown
Contributor Author

Landed on main in 189a730 through #9842, the top of the declared stack #9643 → #9842; the stack review approved both. Its squash commit lists every part.

github-actions Bot added a commit that referenced this pull request Nov 5, 2026
cixzhang pushed a commit that referenced this pull request Nov 5, 2026
Main's DateInput, DateTimeInput and DateRangeInput calendar change
(#9643, #9842) re-padded DateInput.spec.md's tables. FR14's
requirement row is the only conflict. The merge keeps main's new
column width and this branch's FR14 text, byte for byte.
@github-actions
github-actions Bot deleted the nynexman4464/feat/calendar-typed-entry branch November 5, 2026 06:03
cixzhang added a commit that referenced this pull request Nov 5, 2026
…eturns (#9915)

* docs(AST-094, AST-057): motion guidance; gesture springs; swipe-row returns

* docs(AST-094): springs where release velocity matters; a measured curve for geometry-keyed gesture motion

* docs(AST-094): tap-, key- and program-started motion picks the duration step by its documented role

* docs(AST-094): tap-started motion plays the token nearest its platform measurement in the Storybook theme

* docs(AST-094): FR45's step rule, FR4's measured spring and the curve arm

FR45's token-picking sentence now covers only tap-, key- and
program-started motion whose record names no duration step. A
tap-started exit keeps `--duration-exit` and `--ease-exit` (FR7), and
ProgressBar FR4's fill keeps `--duration-medium`.

FR4's exception lists a measured gesture spring without a named role in
its component's motion table with its platform source. FR4's role row
admits that spring, and the pager's measured settle reads as covered by
the exception; the program's animated scroll stays the pager's gap.

FR45's browser row, DEC-26's opening and Lightbox FR5 state the curve
arm: a release that carries the gesture's velocity springs, and a settle
keyed by geometry, such as zoom ratio, may play a measured curve that
cites its measurement.

* docs(AST-094): motion follows a component's main interaction; companions keep its pace; springs pair with timing tiers

* docs(AST-094, AST-057): a gesture component's tap-started close plays its spring; the wheel turn plays springs.settle

* Merge remote-tracking branch 'refs/remotes/origin/main' into docs/motion-guidance-gesture-springs

* docs(AST-094): the layout glide plays curve tokens; Switch and SegmentedControl are gesture-capable

* docs(AST-094, components): align Switch, SegmentedControl, ContextMenu, Slider, Lightbox, DateInput and AST-057 to the main-interaction rule

* docs(AST-094, Switch): the thumb lift plays switchControl.lift; FR4's exception covers only a gesture-driven exit

* docs(AST-090, AST-094, components): exit timing scoped to tap components; Slider, Switch and Lightbox wording follows the main-interaction rule

* Merge main into the branch

Main's DateInput, DateTimeInput and DateRangeInput calendar change
(#9643, #9842) re-padded DateInput.spec.md's tables. FR14's
requirement row is the only conflict. The merge keeps main's new
column width and this branch's FR14 text, byte for byte.

* docs(AST-094, AST-090, Switch, SegmentedControl): the gesture-capable spring applies under touch; a mouse click or a key keeps the theme's curve

* docs(Switch, SegmentedControl, AST-094): under touch every input settles on the spring; without touch the theme's curve, as released

* docs(AST-094, AST-090, Switch): restore one line per Current-state impact entry; Switch's well springs play for every touch change

* Merge main into docs/motion-guidance-gesture-springs

Co-authored-by: Christopher Chedeau <[email protected]>

This branch was successfully deployed

1 active deployment
Preview — 244970c2 Deployed Nov 5, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot. needs:design-review Affects visuals — Design should review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] DateInput, DateTimeInput: typing a numeric date fires onChange with month-first dates on the way

1 participant