Repository navigation
feat(DateInput, DateTimeInput): a non-Gregorian calendar uses the Astryx picker - #9793
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
There was a problem hiding this comment.
Approval waits on an engineering owner's decision about the spec change this pull request makes; no blocking code defect was found.
- To settle: current
spec:AST-043FR2 says an explicitpresentation="native"always shows the native surface. This head rewrites FR1–FR3, addingcomponent:DateInputFR17 andcomponent:DateTimeInputFR11, so that outsidegregoryandiso8601such a field shows the Astryx popover or bottom sheet and warns in development. The rewrite citesspec:AST-111FR15 and DEC-7, which are still draft and not on main.
Any engineering owner, the author included if they are one, can record approval of that exception by commenting /approve-spec with the full head commit SHA. Two small non-blocking notes are inline: the matrix test titles leave out the expected surface, and the warning comment says once per calendar where the key is per component and calendar.
[Automated review]
|
|
||
| describe('DateInput surface in a calendar', () => { | ||
| it.each(CASES)( | ||
| '%s in %s on a %s pointer shows the %s', |
There was a problem hiding this comment.
Non-blocking: this format gets [name, props, calendar, pointer, surface], so a case reads "native in { presentation: 'native' } on a persian pointer shows the fine", and the expected surface never appears. Put props last in each CASES tuple so the four placeholders get name, calendar, pointer and surface. The same applies at line 256.
| // Synchronizes the development console. warnOnce makes a replay or a | ||
| // second field a no-op, so the warning appears once for each calendar. |
There was a problem hiding this comment.
Non-blocking: the key includes the component, so a Persian DateInput and a Persian DateTimeInput on one page each warn once. Suggested wording: "Synchronizes the development console. The key is the component and calendar, so a replay or a second field does not warn again."
302c777 to
bd1f569
Compare
There was a problem hiding this comment.
Approval waits on an engineering owner's decision about the spec change this pull request makes, and one code fix is needed after that.
- To settle: current
spec:AST-043FR2 says an explicitpresentation="native"always shows the native surface (and FR3 keepsnativePickerexactly as released), while this pull request rewrites FR1–FR3 and addscomponent:DateInputFR17 andcomponent:DateTimeInputFR11 so that outsidegregoryandiso8601those values show the Astryx popover or bottom sheet and an explicitnativewarns, citingspec:AST-111FR15 and DEC-7, which are still draft and not on main. - Required fix:
isGregorianCalendarinutils/calendarSystem.tsrepeats thegregory/iso8601test thatuseTypedDate.tskeeps inline at lines 114 and 218, so call the shared helper there and the presentation and typed-entry rules cannot drift apart.
Any engineering owner, the author included if they are one, can record approval of the spec change by commenting /approve-spec with the full head commit SHA. Two small non-blocking notes are inline.
[Automated review]
| * Whether `<input type="date">` can show the calendar. The native control is | ||
| * Gregorian by specification, so only `gregory` and `iso8601` qualify. | ||
| */ | ||
| export function isGregorianCalendar(calendar: CalendarSystem): boolean { |
There was a problem hiding this comment.
This predicate is the same test useTypedDate.ts keeps inline at lines 114 and 218 (calendar === 'gregory' || calendar === 'iso8601'). Please call isGregorianCalendar(calendar) and isGregorianCalendar(providerCalendar) there, so the presentation rule and the typed-entry rule share one definition of a Gregorian calendar.
|
|
||
| describe('DateInput surface in a calendar', () => { | ||
| it.each(CASES)( | ||
| '%s in %s on a %s pointer shows the %s', |
There was a problem hiding this comment.
Non-blocking: this format gets [name, props, calendar, pointer, surface], so a case reads "native in { presentation: 'native' } on a persian pointer shows the fine" and the expected surface never appears. Put props last in each CASES tuple so the four placeholders get name, calendar, pointer and surface (same at line 256).
| // Synchronizes the development console. warnOnce makes a replay or a | ||
| // second field a no-op, so the warning appears once for each calendar. |
There was a problem hiding this comment.
Non-blocking: the key includes the component, so a Persian DateInput and a Persian DateTimeInput on one page each warn once. Suggested wording: "Synchronizes the development console. The key is the component and calendar, so a replay or a second field does not warn again."
d3fbd62 to
2187c77
Compare
bd1f569 to
698fdd8
Compare
There was a problem hiding this comment.
Approval waits on an engineering owner's decision about the spec change this pull request makes, and one code fix is needed after that.
- To settle: current
spec:AST-043FR2 says an explicitpresentation="native"always shows the native surface (and FR3 keepsnativePickerexactly as released), while this pull request rewrites FR1–FR3 and addscomponent:DateInputFR17 andcomponent:DateTimeInputFR11 so that, outsidegregoryandiso8601, those values and the default show the Astryx popover or bottom sheet (for the time control too) and an explicitnativewarns, citingspec:AST-111FR15 and DEC-7, which are still draft and not on main. - Required fix:
isGregorianCalendarinutils/calendarSystem.tsrepeats thegregory/iso8601test thatuseTypedDate.tskeeps inline at lines 117 and 221, so call the shared helper there and the presentation and typed-entry rules cannot drift apart.
Any engineering owner, the author included if they are one, can record approval of the spec change by commenting /approve-spec with the full head commit SHA. A small non-blocking note is inline.
[Automated review]
| * Whether `<input type="date">` can show the calendar. The native control is | ||
| * Gregorian by specification, so only `gregory` and `iso8601` qualify. | ||
| */ | ||
| export function isGregorianCalendar(calendar: CalendarSystem): boolean { |
There was a problem hiding this comment.
This predicate is the same test useTypedDate.ts keeps inline at lines 117 and 221 (calendar === 'gregory' || calendar === 'iso8601'). Please call isGregorianCalendar(calendar) and isGregorianCalendar(providerCalendar) there, so the native-control rule and the typed-entry rule share one definition and cannot drift apart.
|
|
||
| describe('DateInput surface in a calendar', () => { | ||
| it.each(CASES)( | ||
| '%s in %s on a %s pointer shows the %s', |
There was a problem hiding this comment.
Non-blocking: this title format receives [name, props, calendar, pointer, surface], so a case reads "native in { presentation: 'native' } on a persian pointer shows the fine" and the expected surface never appears. Dropping props from the title, or putting it last in each CASES tuple, fixes it; the DateTimeInput block at line 256 uses the same format.
2187c77 to
b3b17f4
Compare
698fdd8 to
5576696
Compare
There was a problem hiding this comment.
Approval waits on an engineering owner's decision about the spec change this pull request makes, and one record fix is needed after that.
- To settle: current
spec:AST-043FR2 says an explicitpresentation="native"always shows the native surface (and FR3 keepsnativePickerexactly as released), while this pull request rewrites FR1–FR3 and addscomponent:DateInputFR18 andcomponent:DateTimeInputFR12 so that, outsidegregoryandiso8601, those values and the default show the Astryx popover or bottom sheet (for the time control too) and an explicitnativewarns, citingspec:AST-111FR15 and DEC-7, which are still draft and not on main. - Required fix: the new calendar requirement takes the id
component:DateInputFR18, which the current DateInput record on main already gives to the wheel accent-mark requirement, so give it the next free id when the stack rebases onto main and update its references in both records. - Non-blocking, from the base branch:
apps/storybook/stories/DateInput.stories.tsximportsInternationalizationProvidertwice, so Storybook does not start and the newCalendarSystemPresentationsstory cannot render until that is fixed.
Any engineering owner, the author included if they are one, can record approval of the spec change by commenting /approve-spec with the full head commit SHA. The earlier shared Gregorian-test finding is fixed.
[Automated review]
| | 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). | `spec:AST-111` FR3, FR9–FR14; current source; parser, round-trip, and calendar typed-entry tests | | ||
| | FR18 | With a calendar other than `gregory` or `iso8601`, every presentation that would show the native control — `adaptive-native`, the default, deprecated `touch` and `always`, and an explicit `native` — shows the popover on a fine pointer and the bottom sheet on a coarse pointer, because the native control is Gregorian (`spec:AST-111` FR15). An explicit `native` also warns once in development. The bottom sheet shows Gregorian dates (Current-state impact). Values stay Gregorian ISO dates (`spec:AST-111` FR3). | `spec:AST-111` FR3, FR15; current source; calendar presentation and no-`Temporal` tests | |
There was a problem hiding this comment.
The current DateInput record on main already has an FR18 ("While a wheel coasts, snaps or turns, no row carries the selection band's accent mark"), and FR17 is the sheet wheel's key order. Please give this calendar requirement the next free id when the stack rebases onto main, and update its references in this record (FR2, the Behavior and Compatibility rows, ORD1, the AST-111 link, verification, Current-state impact) and in the DateTimeInput record.
5576696 to
d1906f2
Compare
There was a problem hiding this comment.
Approval waits on an engineering owner's decision about the spec change this pull request makes, and one record fix is needed after that.
- To settle: current
spec:AST-043FR2 says an explicitpresentation="native"always shows the native surface (and FR3 keepsnativePickerexactly as released), while this pull request rewrites FR1–FR3 and addscomponent:DateInputFR18 andcomponent:DateTimeInputFR12 so that, outsidegregoryandiso8601, those values and the default show the Astryx popover or bottom sheet (for the time control too) and an explicitnativewarns, citingspec:AST-111FR15 and DEC-7, which are still draft and not on main; the owner also says whetherarchitecture:public-component-apiINV16, which lets a caller's explicit presentation choice win, needs a calendar exception. - Required fix: the new calendar requirement takes the id
component:DateInputFR18, which the current DateInput record on main already gives to the wheel accent-mark requirement, so give it the next free id when the stack rebases onto main and update its references in both records. - Non-blocking: the
calendarJSDoc inDateInput.tsxand the changeset say only the bottom sheet's months stay Gregorian, but on a touch screen the closed field also shows a Gregorian date; say that the field and its bottom sheet show Gregorian dates there.
Any engineering owner, the author included if they are one, can record approval of the spec change by commenting /approve-spec with the full head commit SHA.
[Automated review]
| | 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). | `spec:AST-111` FR3, FR9–FR14; current source; parser, round-trip, and calendar typed-entry tests | | ||
| | FR18 | With a calendar other than `gregory` or `iso8601`, every presentation that would show the native control — `adaptive-native`, the default, deprecated `touch` and `always`, and an explicit `native` — shows the popover on a fine pointer and the bottom sheet on a coarse pointer, because the native control is Gregorian (`spec:AST-111` FR15). An explicit `native` also warns once in development. The bottom sheet shows Gregorian dates (Current-state impact). Values stay Gregorian ISO dates (`spec:AST-111` FR3). | `spec:AST-111` FR3, FR15; current source; calendar presentation and no-`Temporal` tests | |
There was a problem hiding this comment.
The current DateInput record on main already has an FR18 ("While a wheel coasts, snaps or turns, no row carries the selection band's accent mark"), and FR17 is the sheet wheel's key order. Please give this requirement the next free id when the stack rebases onto main, and update its references here (Behavior and Compatibility rows, the contract row, FR2, ORD1, the AST-111 link, verification and the Current-state gap) and in DateTimeInput.spec.md.
| * The native date control is Gregorian, so with a calendar other than | ||
| * `gregory` or `iso8601` every presentation that would show it uses the | ||
| * popover on a fine pointer and the bottom sheet on a coarse pointer. The | ||
| * bottom sheet's months and wheels stay Gregorian. |
There was a problem hiding this comment.
Non-blocking: on a coarse pointer the closed field also shows a Gregorian date (the sheet's field text is Gregorian), while the same field shows the calendar on a fine pointer. Suggested wording: "On a coarse pointer the field and its bottom sheet show Gregorian dates." The changeset says the same narrower thing.
97e6250 to
6317ada
Compare
d1906f2 to
d35963a
Compare
There was a problem hiding this comment.
Approval waits on an engineering owner's decision about the spec change this pull request makes, and one record fix is needed after that.
- To settle: current
spec:AST-043FR2 says an explicitpresentation="native"always shows the native surface (and FR3 keepsnativePickerresolving exactly as released), while this pull request rewrites FR1–FR3 and addscomponent:DateInputFR21 andcomponent:DateTimeInputFR12 so that, outsidegregoryandiso8601, those values and the default show the Astryx popover or bottom sheet (for the time control too) and an explicitnativewarns, citingspec:AST-111FR15 and DEC-7, which are still draft and not on main; the owner also says whetherarchitecture:public-component-apiINV16, which lets a caller's explicit presentation choice win, needs a calendar exception. - Required fix: the DateInput record's Compatibility/readiness row (
DateInput.spec.md:71) drops the current sentences about the sheet wheels' markup and time-order keys and lists "the touch wheels' scroll input", which no longer has a Current-state entry, so start from the base branch's row and change only "the calendar on the touch and native surfaces" to "the calendar on the touch surface".
Non-blocking:
- Miss: the DateTimeInput record's Public contract row says the calendar shows "on every surface", but FR12 says the sheet's Date panel stays Gregorian; "the date segment and its popover show" matches it.
- The
calendarJSDoc inDateInput.tsxand the changeset say only the bottom sheet's months stay Gregorian, but on a touch screen the closed field also shows a Gregorian date. - Miss: the dense
nativePickerdocs in both.doc.mjsfiles still say "still works as released" with no calendar note. - The description still names DateInput FR17 and DateTimeInput FR11; the records now add FR21 and FR12.
Any engineering owner, the author included if they are one, can record approval of the spec change by commenting /approve-spec with the full head commit SHA.
[Automated review]
| | Behavior | `presentation` selects the picker surface; an omitted value is `adaptive-native`; `presentation` wins over deprecated `nativePicker`; every committed path emits the same controlled ISO-date value and action feedback. The pointer field reads and writes typed dates in the resolved calendar and reports a typed date only when it is complete (FR20). With a calendar other than `gregory` or `iso8601`, a presentation that would show the native control shows the popover on a fine pointer and the bottom sheet on a coarse pointer (FR21). | | ||
| | End-user impact | People type or pick one date using a surface suited to the primary pointer, in the calendar the application chooses. Disabled and busy fields stay focusable; a busy field keeps its ordinary paint with a Spinner while new commits are blocked. | | ||
| | Builder impact | Optional: set `calendar` on the field or its provider, and `min` and `max` on Buddhist and Minguo calendar fields. `changeAction` runs after `onChange` with optimistic busy feedback on every surface. | | ||
| | Compatibility/readiness | `calendar` is additive and the default stays Gregorian. Typed Gregorian entry fires `onChange` only for complete input and keeps an out-of-range date with its error instead of reverting it; text that `parseDateInput` reads still commits on Enter or blur. Calendars that need `Temporal` fall back to Gregorian where it is missing (the `spec:AST-013` FR12 exception). Caller handlers while disabled, fixed field height, a clear control that drops focus, month paging in the touch calendar, the touch wheels' scroll input, and the calendar on the touch surface are listed under Current-state impact. | |
There was a problem hiding this comment.
This row drops two sentences the current DateInput record keeps ("Under a finger, the sheet wheels' markup changes (one strip of flat rows, faded by a layer inside the column). Under every presentation, keys step through the values in time order (FR17).") and lists "the touch wheels' scroll input", which no longer has a Current-state entry here. Please start from the base branch's row and change only "the calendar on the touch and native surfaces" to "the calendar on the touch surface".
| | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | ||
| | Public contract | One controlled ISO date-time value presented through coordinated date and time segments; `presentation` selects Astryx, native, or adaptive picker surfaces. `calendar` selects the calendar system the date segment reads and writes (`spec:AST-111` FR2). | | ||
| | Behavior | Date and time changes emit one combined value; clear emits `undefined`; controlled empty state remains empty in every rendered picker. The pointer date segment reads and writes typed dates in the resolved calendar and reports a typed date only when it is complete (FR11). | | ||
| | Public contract | One controlled ISO date-time value presented through coordinated date and time segments; `presentation` selects Astryx, native, or adaptive picker surfaces. `calendar` selects the calendar system the date segment shows on every surface (`spec:AST-111` FR2). | |
There was a problem hiding this comment.
Non-blocking: "shows on every surface" overstates it, since FR12 and the Current-state entry say the sheet's Date panel shows Gregorian dates. Suggested: "calendar selects the calendar system the date segment and its popover show (spec:AST-111 FR2)."
6317ada to
b178ad7
Compare
4ce034f to
81b9cce
Compare
There was a problem hiding this comment.
Approval waits on an engineering owner's decision about the spec change this pull request makes; no blocking code or record defect remains.
- To settle: current
spec:AST-043FR2 says an explicitpresentation="native"always shows the native surface (and FR3 keepsnativePickerresolving exactly as released), while this pull request rewrites FR1–FR3 and addscomponent:DateInputFR21 andcomponent:DateTimeInputFR12 so that, outsidegregoryandiso8601, those values and the default show the Astryx popover or bottom sheet (the time control too) and an explicitnativewarns; the citedspec:AST-111FR15 and DEC-7 are on main but still draft, and the owner also says whetherarchitecture:public-component-apiINV16 needs the same calendar exception.
The DateInput Compatibility/readiness row now keeps both sheet-wheel sentences, which resolves the earlier record finding.
Non-blocking:
- The consumer docs for
calendar(DateInput.doc.mjs,DateTimeInput.doc.mjs) name only the bottom sheet as Gregorian, while thecalendarJSDoc and the changeset say that on a touch screen the closed field shows Gregorian dates too.
The earlier /approve-spec named a previous head, and an approval counts only for the head it names. Any engineering owner, the author included if they are one, records approval by commenting /approve-spec 81b9cce7348a5d8ddb7c946b4bf360bf93edd258 on this pull request.
[Automated review]
| type: "'gregory' | 'iso8601' | 'buddhist' | 'roc' | 'japanese' | 'persian' | 'indian' | 'hebrew' | 'chinese' | 'dangi' | 'coptic' | 'ethiopic' | 'ethioaa' | 'islamic-civil' | 'islamic-tbla' | 'islamic-umalqura'", | ||
| description: | ||
| 'The calendar the text field reads and writes dates in, and the calendar its popover shows. value, onChange, min, and max stay Gregorian ISO dates. People type a date the way the locale writes it in this calendar, in any decimal digits; the field reports a date only once it is complete, and names a date the calendar does not have. Years are years of this calendar: a Buddhist field reads 2026 as Buddhist year 2026, so set min and max on Buddhist and Minguo calendar fields to catch a Gregorian year typed by mistake. Calendars other than gregory, iso8601, buddhist, roc, and japanese need Temporal, native or a polyfill the application loads; without it the field shows Gregorian dates. The bottom-sheet and native surfaces show Gregorian dates.', | ||
| 'The calendar the text field reads and writes dates in, and the calendar its popover shows. value, onChange, min, and max stay Gregorian ISO dates. People type a date the way the locale writes it in this calendar, in any decimal digits; the field reports a date only once it is complete, and names a date the calendar does not have. Years are years of this calendar: a Buddhist field reads 2026 as Buddhist year 2026, so set min and max on Buddhist and Minguo calendar fields to catch a Gregorian year typed by mistake. Calendars other than gregory, iso8601, buddhist, roc, and japanese need Temporal, native or a polyfill the application loads; without it the field shows Gregorian dates. With a calendar other than gregory or iso8601, a presentation that would show the native date control shows the popover on a fine pointer and the bottom sheet on a coarse pointer, because the native control is Gregorian. The bottom sheet shows Gregorian dates.', |
There was a problem hiding this comment.
Non-blocking: on a touch screen the closed field also shows a Gregorian date, as the calendar JSDoc and the changeset say. Suggested ending: "On a coarse pointer the field and its bottom sheet show Gregorian dates."
| type: "'gregory' | 'iso8601' | 'buddhist' | 'roc' | 'japanese' | 'persian' | 'indian' | 'hebrew' | 'chinese' | 'dangi' | 'coptic' | 'ethiopic' | 'ethioaa' | 'islamic-civil' | 'islamic-tbla' | 'islamic-umalqura'", | ||
| description: | ||
| 'The calendar the date segment reads and writes typed dates in, and the calendar its popover shows. value, onChange, min, and max stay Gregorian ISO datetimes. People type a date the way the locale writes it in this calendar, in any decimal digits; the field reports a date only once it is complete, and names a date the calendar does not have. Years are years of this calendar, so set min and max on Buddhist and Minguo calendar fields to catch a Gregorian year typed by mistake. Calendars other than gregory, iso8601, buddhist, roc, and japanese need Temporal, native or a polyfill the application loads; without it the field shows Gregorian dates. The native and bottom-sheet surfaces show Gregorian dates.', | ||
| 'The calendar the date segment reads and writes typed dates in, and the calendar its popover shows. value, onChange, min, and max stay Gregorian ISO datetimes. People type a date the way the locale writes it in this calendar, in any decimal digits; the field reports a date only once it is complete, and names a date the calendar does not have. Years are years of this calendar, so set min and max on Buddhist and Minguo calendar fields to catch a Gregorian year typed by mistake. Calendars other than gregory, iso8601, buddhist, roc, and japanese need Temporal, native or a polyfill the application loads; without it the field shows Gregorian dates. With a calendar other than gregory or iso8601, a presentation that would show native controls shows the popovers on a fine pointer and the bottom sheet on a coarse pointer, because the native date control is Gregorian. The Date panel of the bottom sheet shows Gregorian dates.', |
There was a problem hiding this comment.
Non-blocking: on a touch screen the closed date segment also shows a Gregorian date. Suggested ending: "On a coarse pointer the field and the Date panel of its bottom sheet show Gregorian dates."
cfeae70 to
62018f3
Compare
81b9cce to
ac999fe
Compare
|
/approve-spec ac999fe |
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet, because it runs only for pull requests that target main or a release branch.
An engineering owner approved this head's calendar exception (spec:AST-043 FR1–FR3, component:DateInput FR21, component:DateTimeInput FR12), the new tests fail on the base and pass on the head, and no blocking defect was found.
- Non-blocking: the Chinese
calendardocs (DateInput.doc.mjs:540,DateTimeInput.doc.mjs:551) still name only the bottom sheet, while the English docs now say the closed field is Gregorian on a coarse pointer too. - Non-blocking: DateTimeInput's
calendarJSDoc does not mention the calendar exception that DateInput's JSDoc states.
[Automated review]
| type: "'gregory' | 'iso8601' | 'buddhist' | 'roc' | 'japanese' | 'persian' | 'indian' | 'hebrew' | 'chinese' | 'dangi' | 'coptic' | 'ethiopic' | 'ethioaa' | 'islamic-civil' | 'islamic-tbla' | 'islamic-umalqura'", | ||
| description: | ||
| '文本字段读写日期所用的历法,也是其弹出日历显示的历法。value、onChange、min 和 max 始终为公历 ISO 日期。用户按当前语言区域在该历法中的写法输入日期,可使用任意十进制数字;只有输入完整时字段才会报告日期,并会指出该历法中不存在的日期。年份是该历法的年份:佛历字段把 2026 读作佛历 2026 年,因此请为佛历和民国纪年字段设置 min 和 max,以发现误输入的公历年份。gregory、iso8601、buddhist、roc 和 japanese 以外的历法需要 Temporal(原生或由应用加载的 polyfill);没有 Temporal 时字段显示公历日期。底部选择器和原生选择器显示公历日期。', | ||
| '文本字段读写日期所用的历法,也是其弹出日历显示的历法。value、onChange、min 和 max 始终为公历 ISO 日期。用户按当前语言区域在该历法中的写法输入日期,可使用任意十进制数字;只有输入完整时字段才会报告日期,并会指出该历法中不存在的日期。年份是该历法的年份:佛历字段把 2026 读作佛历 2026 年,因此请为佛历和民国纪年字段设置 min 和 max,以发现误输入的公历年份。gregory、iso8601、buddhist、roc 和 japanese 以外的历法需要 Temporal(原生或由应用加载的 polyfill);没有 Temporal 时字段显示公历日期。使用 gregory 或 iso8601 以外的历法时,原本显示原生日期控件的呈现会在精细指针上显示弹出层、在粗指针上显示底部选择器,因为原生控件只显示公历。底部选择器显示公历日期。', |
There was a problem hiding this comment.
Non-blocking: the English entry now says that on a coarse pointer the field and its bottom sheet show Gregorian dates; this one still names only the sheet. Suggested ending: "在粗指针上,字段及其底部选择器显示公历日期。"
| type: "'gregory' | 'iso8601' | 'buddhist' | 'roc' | 'japanese' | 'persian' | 'indian' | 'hebrew' | 'chinese' | 'dangi' | 'coptic' | 'ethiopic' | 'ethioaa' | 'islamic-civil' | 'islamic-tbla' | 'islamic-umalqura'", | ||
| description: | ||
| '日期部分读写输入日期所用的历法,也是其弹出日历显示的历法。value、onChange、min 和 max 始终为公历 ISO 日期时间。用户按当前语言区域在该历法中的写法输入日期,可使用任意十进制数字;只有输入完整时字段才会报告日期,并会指出该历法中不存在的日期。年份是该历法的年份,因此请为佛历和民国纪年字段设置 min 和 max,以发现误输入的公历年份。gregory、iso8601、buddhist、roc 和 japanese 以外的历法需要 Temporal(原生或由应用加载的 polyfill);没有 Temporal 时字段显示公历日期。原生选择器和底部选择器显示公历日期。', | ||
| '日期部分读写输入日期所用的历法,也是其弹出日历显示的历法。value、onChange、min 和 max 始终为公历 ISO 日期时间。用户按当前语言区域在该历法中的写法输入日期,可使用任意十进制数字;只有输入完整时字段才会报告日期,并会指出该历法中不存在的日期。年份是该历法的年份,因此请为佛历和民国纪年字段设置 min 和 max,以发现误输入的公历年份。gregory、iso8601、buddhist、roc 和 japanese 以外的历法需要 Temporal(原生或由应用加载的 polyfill);没有 Temporal 时字段显示公历日期。使用 gregory 或 iso8601 以外的历法时,原本显示原生控件的呈现会在精细指针上显示弹出层、在粗指针上显示底部面板,因为原生日期控件只显示公历。底部面板的日期页显示公历日期。', |
There was a problem hiding this comment.
Non-blocking: the English entry now names the closed field too. Suggested ending: "在粗指针上,字段及其底部面板的日期页显示公历日期。"
62018f3 to
9e071b2
Compare
ac999fe to
e460c55
Compare
|
/approve-spec e460c55 |
9e071b2 to
771893f
Compare
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet, because it runs only for pull requests that target main or a release branch.
An engineering owner approved this head's calendar exception (spec:AST-043 FR1–FR3, component:DateInput FR21, component:DateTimeInput FR12), the new presentation tests fail on the base and pass on the head, and no blocking defect was found.
- Non-blocking: the Chinese
calendardocs (DateInput.doc.mjs:540,DateTimeInput.doc.mjs:551) still name only the bottom sheet, while the English docs say the closed field is Gregorian on a coarse pointer too. - Non-blocking: DateTimeInput's
calendarJSDoc does not mention the calendar exception that DateInput's JSDoc states. - Miss: non-blocking, the development warning for an explicit
native(useCalendarPresentation.ts:50-53) says the picker shows the field's calendar, but on a coarse pointer the bottom sheet still shows Gregorian dates until #9794 lands.
[Automated review]
| `presentation="native" shows the Astryx picker in the "${calendar}" ` + | ||
| 'calendar, because the native date control shows only Gregorian ' + | ||
| 'dates: the popover on a fine pointer and the bottom sheet on a ' + | ||
| 'coarse pointer.', |
There was a problem hiding this comment.
Miss, non-blocking: at this head the coarse-pointer bottom sheet shows Gregorian dates (component:DateInput FR21, Current-state impact), so "shows the Astryx picker in the "persian" calendar" overstates it on a phone. Until #9794 lands, suggested: presentation="native" uses the Astryx picker for the "${calendar}" calendar, because the native date control shows only Gregorian dates: the popover on a fine pointer and the bottom sheet on a coarse pointer.
e460c55 to
e812cfa
Compare
|
/approve-spec e812cfa |
…ryx picker The native date control shows only Gregorian dates. In a calendar other than gregory or iso8601, native and adaptive-native use the popover on a fine pointer and the bottom sheet on a coarse pointer, and an explicit native warns in development. AST-043 FR1 and FR3 name the exception.
…g and presentation useTypedDate calls isGregorianCalendar, the same test that decides when the native control can show the calendar. The presentation test names read the expected surface, and the warning comment says what keys it. The provider docs and record say that only the bottom sheet stays Gregorian, and the changeset says that an explicit -u-ca- locale selects the calendar the same way.
The changeset says that a provider locale with a -u-ca- keyword keeps Gregorian dates and the native control; set calendar to choose a calendar.
… narrow the calendar surface claims DateInput's compatibility row keeps the sheet wheels' markup and time-order key sentences (FR17) and changes only the touch-surface calendar entry. DateTimeInput's calendar shows in the date segment and its popover. On a coarse pointer the field and its bottom sheet show Gregorian dates. The dense nativePicker docs name the calendar exception.
…s in the field too
e812cfa to
5eb98bf
Compare
|
/approve-spec 5eb98bf |
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet, because it runs only for pull requests that target main or a release branch.
An engineering owner approved this head's calendar exception (spec:AST-043 FR1–FR3, component:DateInput FR21, component:DateTimeInput FR12); the new presentation tests fail on the base and pass on the head, and no blocking defect was found.
- Non-blocking: the Chinese
calendardocs (DateInput.doc.mjs:540,DateTimeInput.doc.mjs:551) still name only the bottom sheet, while the English docs say the closed field is Gregorian on a coarse pointer too. - Non-blocking: DateTimeInput's
calendarJSDoc does not mention the calendar exception that DateInput's JSDoc states. - Non-blocking: the development warning for an explicit
native(useCalendarPresentation.ts:50-53) says the picker shows the field's calendar, but on a coarse pointer the bottom sheet still shows Gregorian dates until it follows the calendar.
[Automated review]
5eb98bf
into
nynexman4464/feat/calendar-typed-entry
This implements
spec:AST-111(approved in #9605) FR15 and DEC-7, with FR5's fallback, forDateInputandDateTimeInput.User need
A Persian, Hebrew, or Japanese user on a phone opens a date field and sees the native date picker. That picker is Gregorian (Android) or follows the device calendar (iOS), so the date they pick reads as a different date than the field shows. On a desktop, an explicit
presentation="native"has the same problem.Problem and solution fit
gregoryoriso8601, every presentation that would show<input type="date">uses the Astryx popover on a fine pointer and the bottom sheet on a coarse pointer. This coversadaptive-native(the default), the deprecatednativePickervalues, and an explicitpresentation="native", which also warns once in development (DEC-7). DateTimeInput's date and time surfaces follow the same rule.useCalendarPresentationresolves the calendar and the presentation policy it allows;calendarPickerPresentationininputPresentation.tsmapsnativeandadaptive-nativetoadaptive-bottom-sheet;isGregorianCalendarin the calendar-system utility names the calendars the native control can show, anduseTypedDatenow uses it too.Temporal, calendars that need it fall back to Gregorian, and with them the native control (FR5). A-u-ca-keyword in the provider locale does not select the calendar, so such a field keeps Gregorian dates and the native control;calendaron the component or the provider selects one.calendarJSDoc, the consumer docs forcalendarand the changeset say that on a coarse pointer the field and its bottom sheet show Gregorian dates, and the densenativePickerdocs name the calendar exception.Current specification
spec:AST-111FR15, FR3, FR5 and DEC-7 (approved in spec(AST-111): date components use the calendar the application chooses #9605).spec:AST-043FR1–FR3 now name the one exception to an explicitnative: the calendar.component:DateInputFR21 andcomponent:DateTimeInputFR12, each with a Current-state gap for the Gregorian bottom sheet.component:InternationalizationProviderFR10 now says only the bottom sheet andDateRangeInputshow Gregorian dates. The provider's docs and JSDoc say the same and keepmain's statement that Timestamp, PowerSearch, and Lab's Schedule write their dates in the calendar.Public delta and caller burden
nativewarns once in development.gregory/iso8601, and no change withoutTemporalfor the calendars that need it.Design and alternatives
spec:AST-111DEC-7): keeping an explicitnativenative. The device, not the application, would then choose the calendar.Evidence
nativePickervalue × Gregorian/Persian × fine/coarse pointer for DateInput and DateTimeInput, the provider calendar, and the explicit-native warning (once, and not for Gregorian or the defaults).Temporaltests: a Persian field becomes Gregorian with the native control and a warning; an explicitnativestays native; a Persian bottom sheet shows Gregorian months; a Persian DateTimeInput shows Gregorian native controls.Temporal, with the polyfill, and with noTemporal; WebKit (Safari 26.5) with the polyfill and with noTemporal.Screenshots
Chromium 149 with native Temporal unless noted.
Scope
Testing
pnpm exec vitest run --maxWorkers=4over the presentation and no-Temporaltests,packages/core/src/i18n,docPropLiterals.test.tsand the CLI core prop docs test, after the restack onto currentmain(with Lab's Schedule): 16 files, 218 tests passed. CI runs the full suites.docPropLiterals.test.ts: 5 files, 38 tests pass.pnpm exec tsc --noEmit -p packages/core: passes.pnpm check:knowledge,pnpm check:changesets: pass.node scripts/pre-review.mjs --base nynexman4464/feat/calendar-typed-entry: 1,072 authored lines.Writing rubric results
spec:AST-043component:DateInput(#5074)is part of a quoted test title.component:DateTimeInputcomponent:InternationalizationProvider