Repository navigation
feat(Timestamp, PowerSearch): write dates in the provider's calendar - #9639
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. Built-in date formats that follow the provider's calendar (Timestamp's date formats, PowerSearch values, Schedule labels and the new calendar helper arguments) rest only on the draft spec:AST-111 FR18, while the current internationalization architecture (INV10) and Timestamp FR2 still pin Gregorian. An engineering owner records that decision by commenting /approve-spec <full head SHA> on this pull request; the author may do so if they are an engineering owner. Whatever the decision, these need fixing:
- Relative Timestamps now fail hydration when the server lacks
Temporalbut the browser has it (Timestamp.tsx:367, Timestamp FR3); keep the pre-hydration placeholder Gregorian. - Schedule's
isSameCalendarMonthworks out calendar months a second way; re-export Core'scalendarMonthOfthrough the internal entry and call it. - The title says charts follow the provider calendar, and the body says Astryx call sites pass the calendar to
formatSharedDate; neither is true yet, so narrow the wording.
[Automated review]
| isClockPending | ||
| ? {timeZone: 'UTC', isTimezoneShown: true} | ||
| : {isTimezoneShown}, | ||
| ? {timeZone: 'UTC', isTimezoneShown: true, calendar} |
There was a problem hiding this comment.
With a calendar that needs Temporal, the server and the browser can resolve different calendars here. On a server without Temporal (Node 24) the placeholder is Gregorian; a browser with native Temporal writes it in Persian, and React reports "Hydration failed because the server rendered text didn't match the client". Timestamp FR3 says the server markup hydrates without a mismatch. The client replaces this placeholder after hydration, so keeping it Gregorian ({timeZone: 'UTC', isTimezoneShown: true}) avoids the mismatch.
|
|
||
| // A Gregorian month or year can span two months or years of another calendar, | ||
| // so ranges compare the calendar's own fields. | ||
| function isSameCalendarMonth( |
There was a problem hiding this comment.
Core's calendarMonthOf (packages/core/src/utils/calendarSystem.ts) already decides which calendar month a Gregorian day falls in, and Calendar uses it. This string comparison is a second path, and the two already disagree: under japanese, Gregorian January 1989 is one month to Core but two here ("January 64 Shōwa - January 1 Heisei"). Re-export calendarMonthOf from @astryxdesign/core/internal/calendar-system and compare calendarMonthOf(calendar, a).start for both dates.
| calendar: 'gregory', | ||
| }), | ||
| ); | ||
| /** One date formatter per locale and calendar. */ |
There was a problem hiding this comment.
Non-blocking: this comment restates byLocaleAndCalendar. Delete it.
e5a8d85 to
accd0ed
Compare
There was a problem hiding this comment.
Approval waits on an engineering owner's decision. Built-in date formats that follow the provider's calendar (Timestamp's date formats, its card and accessible name, PowerSearch values, Schedule labels, and the new calendar arguments on formatSharedDate and formatFilterValue) rest only on the draft spec:AST-111 FR18, while the current internationalization architecture (INV10) and Timestamp FR2 still pin Gregorian. An engineering owner records that decision by commenting /approve-spec <full head SHA> on this pull request; the author may do so if they are an engineering owner. Whatever the decision, these need fixing:
- Relative Timestamps fail hydration when the server lacks
Temporalbut the browser has it (Timestamp.tsx:367, Timestamp FR3), so keep the pre-hydration placeholder Gregorian and state the both-sides-Temporalcondition next to FR3's zone gap. - Under
chineseanddangi, Timestamp, PowerSearch and Schedule write dates with rawIntlwhileCalendaruses Core'sformatCalendarDate, so Gregorian 2027-02-06 is day 1 of First Month inCalendarbut the 30th of Twelfth Month beside it; route these labels, and Schedule'sisSameCalendarMonth, through Core's calendar helpers. InternationalizationProvider's docs and record at this head still say the provider calendar reaches onlyCalendar, so update them to name Timestamp, PowerSearch and Schedule.- The title (charts), the body ("Astryx call sites pass the resolved calendar", "always agree") and the changeset's opening sentence claim more than the change does, so narrow them to the components that pass the calendar.
[Automated review]
| isClockPending | ||
| ? {timeZone: 'UTC', isTimezoneShown: true} | ||
| : {isTimezoneShown}, | ||
| ? {timeZone: 'UTC', isTimezoneShown: true, calendar} |
There was a problem hiding this comment.
With a calendar that needs Temporal, a server without it (Node 24) writes this placeholder in Gregorian and a browser with native Temporal writes it in that calendar, so React reports "Hydration failed because the server rendered text didn't match the client" (Timestamp FR3). The client replaces the placeholder after hydration, so keeping it Gregorian ({timeZone: 'UTC', isTimezoneShown: true}) removes the mismatch.
|
|
||
| // A Gregorian month or year can span two months or years of another calendar, | ||
| // so ranges compare the calendar's own fields. | ||
| function isSameCalendarMonth( |
There was a problem hiding this comment.
Core's calendarMonthOf and formatCalendarDate (packages/core/src/utils/calendarSystem.ts) already decide calendar months and write a day the way Calendar shows it. This string comparison and the raw-Intl labels are a second path that disagrees: under japanese, Gregorian January 1989 is one month to Calendar and two here, and under chinese, 2027-02-06 is day 1 of First Month in Calendar but day 30 here. Re-export those helpers from @astryxdesign/core/internal/calendar-system and call them.
| calendar: 'gregory', | ||
| }), | ||
| ); | ||
| /** One date formatter per locale and calendar. */ |
There was a problem hiding this comment.
Non-blocking: this comment restates byLocaleAndCalendar; delete it.
There was a problem hiding this comment.
Approval waits on an engineering owner's decision. Built-in date formats that follow the provider's calendar (Timestamp's date formats, its hover card and accessible name, PowerSearch values, Schedule labels, and the new calendar arguments on formatSharedDate and formatFilterValue) rest only on the draft spec:AST-111 FR18, which is not on main, while the current internationalization architecture (INV10) and Timestamp FR2 still pin the Gregorian calendar. An engineering owner records that decision by commenting /approve-spec <full head SHA> on this pull request; the author may do so as an engineering owner. Whatever the decision, these need fixing:
- A server without
Temporalfails React hydration in a browser that has it (Timestamp.tsx:367, Timestamp FR3), so keep the pre-hydration placeholder Gregorian and state in the rewritten record that date formats hydrate cleanly only when both sides haveTemporalor both lack it. - Under
chineseanddangi, Timestamp, PowerSearch and Schedule write dates with rawIntlwhileCalendaruses Core'sformatCalendarDate, so with nativeTemporalGregorian 2027-02-06 is day 1 of First Month inCalendarbut the 30th of Twelfth Month beside it; route these labels, and Schedule'sisSameCalendarMonth, through Core's calendar helpers. - The
InternationalizationProviderdocs and prop description still say the calendar is whatCalendarshows, so name Timestamp, PowerSearch and Schedule there too. - The title includes charts, which never read the provider, and the body says Astryx call sites pass the calendar and that a Timestamp and a Calendar always agree, which
formatSharedDate's callers and the Chinese case contradict, so narrow that wording.
[Automated review]
| isClockPending | ||
| ? {timeZone: 'UTC', isTimezoneShown: true} | ||
| : {isTimezoneShown}, | ||
| ? {timeZone: 'UTC', isTimezoneShown: true, calendar} |
There was a problem hiding this comment.
With a calendar that needs Temporal, a server without it (Node 24) writes this placeholder in Gregorian and a browser with native Temporal writes it in that calendar, so React reports "Hydration failed because the server rendered text didn't match the client" (Timestamp FR3). Keep the placeholder Gregorian; the client replaces it after hydration:
isClockPending
? {timeZone: 'UTC', isTimezoneShown: true}
: {isTimezoneShown, calendar},| timeZoneName: timeZoneNameStyle, | ||
| ...zone, | ||
| calendar: 'gregory', | ||
| calendar, |
There was a problem hiding this comment.
Under chinese and dangi, raw Intl and the runtime's Temporal disagree on some month starts, and Calendar names days through Core's formatCalendarDate (utils/calendarSystem.ts), which follows Temporal. With native Temporal, Gregorian 2027-02-06 is day 1 of First Month in Calendar but "Twelfth Month 30, 2026" here. Format the date part through the same helper so the two agree.
|
|
||
| // A Gregorian month or year can span two months or years of another calendar, | ||
| // so ranges compare the calendar's own fields. | ||
| function isSameCalendarMonth( |
There was a problem hiding this comment.
Core's calendarMonthOf (packages/core/src/utils/calendarSystem.ts) already decides which calendar month a Gregorian day falls in, and Calendar uses it. This string comparison is a second path that disagrees with it: under japanese, January 1989 is one month to Calendar and two here. Export calendarMonthOf and formatCalendarMonthLabel through @astryxdesign/core/internal/calendar-system and call them instead.
| type: "'gregory' | 'iso8601' | 'buddhist' | 'roc' | 'japanese' | 'persian' | 'indian' | 'hebrew' | 'chinese' | 'dangi' | 'coptic' | 'ethiopic' | 'ethioaa' | 'islamic-civil' | 'islamic-tbla' | 'islamic-umalqura'", | ||
| required: false, | ||
| description: | ||
| "Calendar system that `Calendar` in the subtree shows, such as 'persian', 'hebrew', or 'buddhist'. `DateInput`, `DateRangeInput`, and `DateTimeInput` show Gregorian dates. When omitted, a `-u-ca-` keyword in `locale` selects the calendar, else Gregorian; a locale's default calendar never applies. A component's own `calendar` prop takes precedence. Values stay Gregorian ISO dates. Calendars other than gregory, iso8601, buddhist, roc, and japanese need `Temporal`; where the runtime lacks it, load a polyfill such as `temporal-polyfill/full/global` on the server and in the browser, or those calendars show Gregorian dates and warn in development.", |
There was a problem hiding this comment.
With this pull request the provider calendar also rewrites Timestamp, PowerSearch and Schedule dates, but this description (and the prop JSDoc in InternationalizationProvider.tsx) still says it is the calendar that Calendar shows. Name those components here so builders know what setting calendar changes.
| calendar: 'gregory', | ||
| }), | ||
| ); | ||
| /** One date formatter per locale and calendar. */ |
There was a problem hiding this comment.
Non-blocking: this comment restates byLocaleAndCalendar; delete it.
c13e940 to
53da574
Compare
f6e7414 to
40aa346
Compare
There was a problem hiding this comment.
Approval waits on an engineering owner's decision. Built-in date formats that follow the provider's calendar (Timestamp's date formats, its hover card and accessible name, PowerSearch values, Schedule labels, the switch for existing -u-ca- locales, and the new calendar arguments on formatSharedDate and formatFilterValue) rest only on the draft spec:AST-111 FR18, which is not on main, while the current internationalization architecture (INV10) and Timestamp FR2 still pin the Gregorian calendar. An engineering owner records that decision by commenting /approve-spec <full head SHA> on this pull request; the author may do so as an engineering owner. Whatever the decision, these need fixing:
- A server without
Temporalfails React hydration in a browser that has it (Timestamp.tsx:367, Timestamp FR3), so keep the pre-hydration placeholder Gregorian and state in FR3 that date formats hydrate cleanly only when both sides haveTemporalor both lack it. - Under
chineseanddangi, Timestamp, PowerSearch and Schedule write dates with rawIntlwhileCalendaruses Core'sformatCalendarDate, so with nativeTemporalGregorian 2027-02-06 is day 1 of First Month inCalendarbut the 30th of Twelfth Month beside it; route these labels, and Schedule'sisSameCalendarMonth, through Core's calendar helpers. - The
InternationalizationProviderdocs and prop description still say the calendar is whatCalendarshows, so name Timestamp, PowerSearch and Schedule there too. - The title includes charts, whose formatters never read the provider, and the body says Astryx call sites pass the calendar to
formatSharedDateand that a Timestamp and a Calendar always agree, so narrow that wording.
[Automated review]
|
Heads-up: #9790 removed |
There was a problem hiding this comment.
Approval waits on an engineering owner's decision: built-in date formats that follow the provider's calendar (Timestamp's date formats, its hover card and accessible name, PowerSearch values, Schedule labels, the switch for existing -u-ca- locales, and the new calendar arguments on formatSharedDate and formatFilterValue), together with the new Timestamp FR2/FR3 text and the browser-support exceptions in the Timestamp and PowerSearch records, rest only on the draft spec:AST-111 FR18, which is not on main, while the current internationalization architecture (INV10) and Timestamp FR2 still pin the Gregorian calendar. An engineering owner records that decision by commenting /approve-spec <full head SHA> on this pull request; the author may do so as an engineering owner. Whatever the decision, these need fixing:
- Under
chineseanddangi, Timestamp, PowerSearch and Schedule write dates with rawIntlwhileCalendaruses Core'sformatCalendarDate, so in Chromium with nativeTemporalGregorian 2027-02-06 is day 1 of First Month inCalendarbut the 30th of Twelfth Month beside it, and Schedule'sisSameCalendarMonthsplits Gregorian January 1989 underjapanesewhere Core'scalendarMonthOfdoes not; route these labels through Core's calendar helpers. - The
InternationalizationProviderdocs and prop description still say the calendar is whatCalendarshows, so name Timestamp, PowerSearch and Schedule there too. - The title includes charts, whose formatters never read the provider, and the body says Astryx call sites pass the calendar to
formatSharedDateand that a Timestamp and a Calendar always agree, so narrow that wording.
[Automated review]
| ...SHARED_DATE_FORMAT_OPTIONS.date_long, | ||
| ...zone, | ||
| calendar: 'gregory', | ||
| calendar, |
There was a problem hiding this comment.
Under chinese and dangi, raw Intl and the runtime's Temporal disagree on some month starts, and Calendar names days through Core's formatCalendarDate (utils/calendarSystem.ts), which follows Temporal. In Chromium 149 with native Temporal, Gregorian 2027-02-06 is day 1 of First Month in Calendar but "Twelfth Month 30, 2026" here (and in formatFilterValue.ts). Format the date part through the same helper so the two agree.
|
|
||
| // A Gregorian month or year can span two months or years of another calendar, | ||
| // so ranges compare the calendar's own fields. | ||
| function isSameCalendarMonth( |
There was a problem hiding this comment.
Core's calendarMonthOf (packages/core/src/utils/calendarSystem.ts) already decides which calendar month a Gregorian day falls in, and Calendar uses it. This string comparison is a second path that disagrees with it: under japanese, Gregorian January 1989 is one month to Calendar ("January 1 Heisei") and two here ("January 64 Shōwa - January 1 Heisei"). Export calendarMonthOf and formatCalendarMonthLabel through @astryxdesign/core/internal/calendar-system and call them here.
| calendar: 'gregory', | ||
| }), | ||
| ); | ||
| /** One date formatter per locale and calendar. */ |
There was a problem hiding this comment.
Non-blocking: this comment restates byLocaleAndCalendar; delete it.
53da574 to
fe3c951
Compare
48a3e9e to
6c500c9
Compare
There was a problem hiding this comment.
Approval waits on an engineering owner's decision: built-in date formats that follow the provider's calendar (Timestamp's date formats, its hover card and accessible name, PowerSearch values, Schedule labels, the switch for existing -u-ca- locales, and the new calendar arguments on formatSharedDate and formatFilterValue), together with the rewritten Timestamp FR2/FR3 and the new browser-support exceptions in the Timestamp and PowerSearch records, rest only on the draft spec:AST-111 FR18, which is not on main, while the current internationalization architecture (INV10) and Timestamp FR2 still pin the Gregorian calendar. An engineering owner records that decision by commenting /approve-spec <full head SHA> on this pull request; the author may do so as an engineering owner.
Whatever the decision, these need fixing:
- Timestamp's
date_timeand full date (formatInstant.ts:195,:230),formatDateAbsolute,formatSharedDate, Schedule's month title, week and event ranges, and the chart helpers pass the resolved calendar straight toIntlinstead of through Core's calendar labels, so undercalendar="iso8601"date_timereads "2026 Oct 30, 12:00 PM" in Chromium and loses its month in Node 24 whiledate_longandCalendarread "October 30, 2026", and Chinese and Korean dates informatSharedDateand Schedule's ranges can name another day thanCalendar; route them through one Core helper that applieslabelCalendarandTemporal's day, and addiso8601to the tests. - The title names charts, whose formatters never read the provider, and the body says Astryx call sites pass the calendar to
formatSharedDateand that a Timestamp and a Calendar always agree, so narrow that wording.
Two new comments run past the comment style's sentence limit; suggested rewrites are inline.
[Automated review]
| ...zoneName, | ||
| ...zone, | ||
| calendar: 'gregory', | ||
| calendar, |
There was a problem hiding this comment.
Under calendar="iso8601" this writes "2026 Oct 30, 12:00 PM" in Chromium 149 and "2026 30, 12:00 PM", with no month, in Node 24, while date_long above goes through formatInstantDate and Core's labelCalendar and reads "October 30, 2026". full at line 195 has the same problem, and it feeds the hover card and the relative accessible name. Route the date part through the shared calendar formatter (extended for a time of day), or at least apply labelCalendar, and add iso8601 to the calendar test matrix.
| return plainDateFormat(pd, SHARED_DATE_FORMAT_OPTIONS[format], locale); | ||
| return plainDateFormat( | ||
| pd, | ||
| {...SHARED_DATE_FORMAT_OPTIONS[format], calendar}, |
There was a problem hiding this comment.
formatSharedDate(day, 'date', 'en', 'iso8601') returns "2026 30" in Node 24, and under chinese this raw Intl path can name another day than Timestamp's date and Calendar, which go through formatCalendarDate. Use the same helper for non-Gregorian calendars.
| year: 'numeric', | ||
| timeZone: timezoneID, | ||
| calendar: 'gregory', | ||
| calendar, |
There was a problem hiding this comment.
Under iso8601 this range reads "2026 25–31" in Node 24, and the month title from LocalizedMonthTitle (line 170) reads "2026 October" in Chromium while the table name reads "October 2026". Under chinese the range can disagree with the day numbers, which now go through formatCalendarDate. Apply Core's label calendar here, in LocalizedMonthTitle and in formatEventDateTimeRange.
| // The pre-hydration placeholder is written in UTC, labelled, so | ||
| // the server and the hydrating client produce the same text in | ||
| // every time zone. | ||
| // The pre-hydration placeholder is Gregorian and in UTC, labelled, |
There was a problem hiding this comment.
Non-blocking (comment style): this is one 28-word sentence. Suggested: "The placeholder before hydration is Gregorian and in UTC, with its zone. The server and the client then write the same text, with or without Temporal."
| timeZone: timezoneID, | ||
| calendar: 'gregory', | ||
| }).format(new Date(plainDateToInstant(date, timezoneID, 12))); | ||
| // Core's helper names the month and day that its Calendar shows; raw Intl |
There was a problem hiding this comment.
Non-blocking (comment style): 26 words with two topics. Suggested: "Core's helper names the month and day that Calendar shows. Raw Intl can start a Chinese or Korean month on another day."
fe3c951 to
0041c70
Compare
6c500c9 to
3a9bb8b
Compare
A Calendar systems story shows Timestamp's date formats, a PowerSearch date value, and Calendar in the Persian calendar, in English and Farsi, with system_date_time staying Gregorian ISO.
…r calendars that need Temporal
…ration placeholder Gregorian Date-only Timestamp formats and PowerSearch's token value name the month and day through Core's calendar helpers, so a month start in the Chinese or Dangi calendar matches Calendar. The clock placeholder is Gregorian, so a server without Temporal hydrates in a browser with it. The provider docs name the components that follow the calendar, and the records state that an explicit -u-ca- locale is the application's request.
Timestamp's date_time and full date, PowerSearch's date-and-time value, and the chart helpers now format their dates through Core's calendar labels. Each one names the month and day that Calendar shows, also where Intl and Temporal disagree on a Chinese or Dangi calendar month start, and iso8601 reads as Gregorian. Times still come from Intl. plainDateFormat with a calendar option other than gregory follows the same labels, so formatSharedDate and the chart helpers agree with Calendar. The Temporal stand-in that runs ahead of Intl moves to a shared test helper.
…ian dates The Timestamp and PowerSearch records and the changeset say that a provider locale with a -u-ca- keyword keeps Gregorian dates, and the Timestamp test asserts it.
formatCalendarInstant cached its formatter without a time zone, so after the device's zone changed, Timestamp and PowerSearch dates kept the old zone.
6ebed8d to
396e07d
Compare
PR Analysis Report🔎 Preview ·
|
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| Calendar · Storybook | 57.1 kB (+118 B) · 9.3 kB CSS (0) | 1,708 (0) | ✗ · ✓ · ✓ |
| lab/ChartArea | 5.9 kB (0) · 20 B CSS (0) | — | — · ✓ · ✗ |
| lab/ChartBar | 3.7 kB (0) · 20 B CSS (0) | — | — · ✓ · ✗ |
18 more components
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| lab/ChartCandlestick | 4.4 kB (0) · 20 B CSS (0) | — | — · ✓ · ✗ |
| lab/ChartDot | 3.6 kB (0) · 20 B CSS (0) | — | — · ✓ · ✗ |
| lab/ChartDotGL | 7.5 kB (0) · 20 B CSS (0) | — | — · ✓ · ✗ |
| lab/ChartDotGLInteractive | 8.5 kB (0) · 20 B CSS (0) | — | — · ✓ · ✗ |
| lab/ChartHeatmapGL | 8.6 kB (0) · 20 B CSS (0) | — | — · ✓ · ✗ |
| lab/ChartLine | 5.5 kB (0) · 20 B CSS (0) | — | — · ✓ · ✗ |
| lab/ChartStreamGL | 7.6 kB (0) · 20 B CSS (0) | — | — · ✓ · ✗ |
| lab/CommentThread | 266.0 kB (+1.6 kB) · 2.4 kB CSS (0) | — | — · — · — |
| charts/Chart | 166.7 kB (+1.6 kB) · 494 B CSS (0) | — | — · — · — |
| Timestamp · Storybook | 22.9 kB (+1.5 kB) · 8.9 kB CSS (0) | 688 (+22) | ✓ · ✓ · — |
| lab/Comments | 271.1 kB (+1.5 kB) · 2.5 kB CSS (0) | — | — · — · — |
| PowerSearch · Storybook | 248.9 kB (+318 B) · 22.3 kB CSS (0) | 7,201 (+18) | ✓ · ✓ · ✓ |
| DateTimeInput | 176.4 kB (+195 B) · 17.2 kB CSS (0) | — | — · — · — |
| DateInput | 154.3 kB (+23 B) · 15.5 kB CSS (0) | — | — · — · — |
| lab/Schedule | 63.5 kB (−1 B) · 3.9 kB CSS (0) | — | — · — · — |
| DateRangeInput | 75.4 kB (−77 B) · 11.2 kB CSS (0) | — | — · — · — |
| lab/chart | — | — | — · ✓ · — |
| lab/Chart | — | — | — · ✓ · — |
Visual changes: 2 snapshots in 1 component
A change is a question for the reviewer, not a failure.
| Component · story | Before | After | Diff |
|---|---|---|---|
| Calendar · Default (neutral, light) | ![]() |
![]() |
![]() |
| Calendar · Default (neutral, dark) | ![]() |
![]() |
![]() |
Package size: @astryxdesign/core 6.48 MB packed (+2.5 kB); no new dependencies.
API changes: core +0 · ~2 · −0
Committed API report behind this build: cli 9 rows, core 4 rows; run pnpm api:report.
2 API changes (advisory)
| Package | Where | Signature | Usage | |
|---|---|---|---|---|
| ~ | core |
. · Functions · function formatSharedDate |
function formatSharedDate: (pd: PlainDate, format: SharedDateFormat, locale?: Locale) => string → function formatSharedDate: (pd: PlainDate, format: SharedDateFormat, locale?: Locale, calendar?: CalendarSystem) => string |
import {formatSharedDate} from '@astryxdesign/core'; formatSharedDate(…) |
| ~ | core |
./PowerSearch/utils · Functions · function formatFilterValue |
function formatFilterValue: (_config: InternalConfig, operatorValue: OperatorValue, filterValue: FilterValue, maxLength: number, t: TranslatorFn, locale: Locale, timezoneID?: string) => string → function formatFilterValue: (_config: InternalConfig, operatorValue: OperatorValue, filterValue: FilterValue, maxLength: number, t: TranslatorFn, locale: Locale, timezoneID?: string, calendar?: CalendarSystem) => string |
import {formatFilterValue} from '@astryxdesign/core/PowerSearch/utils'; formatFilterValue(…) |
Touched components checked; add ci:run-visual, ci:run-a11y or ci:run-rtl to run the full suites.
Generated by PR Enrichment workflow | View full report
There was a problem hiding this comment.
Approval waits on an engineering owner's decision. The earlier /approve-spec names a previous head; this head carries the same 11 commits rebased onto main after #9622 landed, and an approval counts only at the exact head.
The decision settles Timestamp's date formats (with its hover-card full date and relative accessible name) and PowerSearch date values written in the provider's calendar, which component:Timestamp FR2 on main still writes "with Gregorian years" and which the draft spec:AST-111 FR18 proposes; the rewritten Timestamp FR2 and FR3, the PowerSearch Calendar bullet and the spec:AST-013 FR12 exceptions; and the optional calendar argument on formatSharedDate and formatFilterValue.
- Miss: PowerSearch's date editor is a
DateInput, which stays Gregorian, so undercalendar="persian"a token reads "Aban 8, 1405 AP" while the editor it opens reads "October 30, 2026"; the decision should say whether that interim state ships, and the PowerSearch docs should then say so.
An engineering owner records the decision by commenting /approve-spec <full head SHA> on this pull request (the author may, as an engineering owner), or says which part should not ship. No code defect was found; the one failing CI check comes from the WebKit interaction jobs timing out while installing system packages, so they need a rerun.
[Automated review]
| change with no public API change. DEC-3 adds the stable `presentation` prop | ||
| and its `adaptive` default, as the two DEC-3 bullets below state. | ||
| - Controlled/uncontrolled behavior: unchanged. | ||
| - Calendar: date values follow the provider's calendar. A provider locale with a |
There was a problem hiding this comment.
Under a provider calendar the token now reads "Aban 8, 1405 AP", but the value editor it opens is a DateInput, which stays Gregorian, and reads "October 30, 2026". FR11 says the trigger's date value "reads as the sheet's date editor shows it". Could this bullet say whether the editor follows the calendar, so the owner decision covers it?
|
/approve-spec 396e07d |
A date token follows the provider's calendar, but the DateInput or DateRangeInput it opens shows the calendar that input resolves, which is Gregorian. The record, the consumer docs, and the changeset now say so.
|
/approve-spec 1c5596f |
There was a problem hiding this comment.
Approved: CI passes on this head.
Timestamp's date formats and PowerSearch date values now follow the InternationalizationProvider calendar, and an engineering owner approved this head, including the rewritten Timestamp FR2 and FR3, the documented PowerSearch editor gap, the spec:AST-013 FR12 exceptions and the optional calendar argument on formatSharedDate and formatFilterValue. The focused tests pass, and the Storybook story shows Timestamp, the PowerSearch token and Calendar naming the same Persian day.
- Optional: PowerSearch FR11 still says a token's date "reads as the sheet's date editor shows it"; a pointer from that row to the new Calendar implementation-gap note would keep FR11 accurate on its own.
[Automated review]
| - Controlled/uncontrolled behavior: unchanged. | ||
| - Calendar: date values follow the provider's calendar. A provider locale with a | ||
| `-u-ca-` keyword keeps Gregorian dates (`spec:AST-111` DEC-2); set the | ||
| provider's `calendar` to choose one. Implementation gap: a date value's |
There was a problem hiding this comment.
Non-blocking: FR11 still says a trigger's date_absolute value "reads as the sheet's date editor shows it (FR17)". A short pointer from that row to this implementation gap would keep FR11 accurate for a reader who lands on it alone.






This implements
spec:AST-111(approved in #9605) FR18 for Timestamp, PowerSearch, the Core date helpers, and the chart formatters.User need
An application that sets
calendar="persian"(orhebrew,buddhist, …) onInternationalizationProvidergets Persian dates inCalendar. But a Timestamp, a PowerSearch date token, or a chart axis beside it still reads Gregorian. One screen then shows the same day in two calendars, so people misread dates.Problem and solution fit
date,date_long,date_weekdayanddate_timeformats, the hover card's full date and itstooltipEntriesrows, and the relative accessible name use the provider's resolved calendar.time, relative,system_*andunix_secondsdon't change. The placeholder that clock formats render before hydration (date_timein UTC) stays Gregorian, so server and client write the same text with or withoutTemporal.date_absolutevalues use it: the token in both presentations, the sheet's Filters rows and removal announcement, andPowerSearchToken. Filter values stay Unix seconds. The value editor a date token opens, aDateInputorDateRangeInput, shows the calendar that input resolves, which is Gregorian: undercalendar="persian"a token reads "Aban 8, 1405 AP" while its editor reads "October 30, 2026". Lab's MobilePowerSearch is not touched: main has removed it, and Core's PowerSearch now carries that touch flow.calendar:formatSharedDate,formatFilterValue, andshortDate/monthYearin@astryxdesign/chartsand LabChart. PowerSearch andPowerSearchTokenpass their resolved calendar toformatFilterValue; no Astryx component callsformatSharedDateor the chart formatters with a calendar.plainDateFormatwith acalendaroption other thangregorygoes through Core's calendar labels and names the month and day thatCalendarshows. WithoutTemporalit keepsIntl's output for that calendar.calendar-systementry it uses are in the pull request stacked above this one, feat(lab): Schedule writes dates in the provider's calendar #9994.Current specification
spec:AST-111FR18, together with FR2 (component prop, then provider prop, thengregory), FR5 (calendars that needTemporal) and DEC-2 (a locale never selects the calendar).architecture:internationalizationINV8–INV10, with INV10 as the base branch states it.spec:AST-013FR12: the Timestamp and PowerSearch records add the browser-support exception for calendars that needTemporal, as Calendar and the date inputs do.Public delta and caller burden
-u-ca-keyword, such asth-TH-u-ca-buddhist, keeps Gregorian dates; set the provider'scalendarto choose one.'gregory':formatSharedDate(pd, format, locale?, calendar?),formatFilterValue(…, timezoneID?, calendar?),shortDate(value, locale, calendar?)andmonthYear(value, locale, calendar?).shortDateandmonthYearwith a calendar other thangregorygo throughplainDateFormat.Temporal: where the runtime lacks it, Timestamp and PowerSearch show Gregorian dates and warn in development, asCalendardoes.Design and alternatives
Formatting reads the same calendar each date component already resolves, including the fallback to Gregorian without
Temporal, so a Timestamp and a Calendar under the same provider show the same calendar and name the same day. Dates, including dates with a time, go through Core's calendar labels, so they name the month and day thatCalendarshows, also whereIntlandTemporaldisagree on a month start in the Chinese or Dangi calendar. Times come fromIntl. An instant formatted in the host's zone gets a formatter built for the call (the internaldateTimeFormatAtCallinplainDate.ts), so after the device's zone changes, its date and time follow the new zone together.Rejected: each formatter picking up its locale's default calendar. FR2 excludes that.
Evidence
Real Chromium against Storybook (the "Formatted Dates Persian" story under Core/Internationalization/Calendar systems), in English and
fa-IR:Temporal: Timestamp, the PowerSearch token and Calendar all show Aban 1405, andsystem_date_timestays2026-10-30 12:00:00.Temporalremoved: Gregorian dates, plus the development warning.Temporalremoved, polyfill loaded: the same as native.Screenshots
calendar="persian", Englishcalendar="persian",fa-IRScope
Testing
pnpm exec vitest run --maxWorkers=2over the test files this pull request changes and the tests beside its changed sources (Timestamp, PowerSearch, Calendar, i18n, utils, and the charts and LabChartformatters) plusdocPropLiterals.test.ts: 111 files, 2,153 of 2,154 tests pass on the previous head, whose source this head keeps. The one failure,hitArea.test.ts"batches every pending control into one frame: all reads, then all writes", fails the same way on themaincommit the stack sits on (d23d1fe438). The last commit changes only the PowerSearch record, its docs and the changeset;docPropLiterals.test.tspasses on it (20 tests).persian,hebrewandbuddhist, each underenand the native locale;system_*andtimeunchanged;iso8601written asgregory;chinesedate whereIntlandTemporaldisagree on the month start, with and without a time;Temporalfallback, withbuddhiststill working, and a clock format server-rendered withoutTemporalthat hydrates;-u-ca-locale that keeps Gregorian dates, and a barefa-IR.tsc --noEmitis clean for core, lab and charts (lab and charts after a fresh core build).pnpm check:knowledgeandpnpm check:changesetspass.node scripts/pre-review.mjs --base main: 1,698 authored lines.Writing rubric results
component:Timestamp:spec:AST-013FR12 exception names its evidence and its gap (no real-browser run, and no hydration test of an absolute date format, under a calendar that needsTemporal).component:PowerSearch:DateInput, or aDateRangeInputfor adate_rangevalue, and shows Gregorian dates), and thespec:AST-013FR12 exception describe behavior in the present tense.PowerSearch.calendarSystems.test.tsxand aPowerSearchBottomSheet.test.tsxcase, and states the gap (no real-browser run, and no server render and hydration test, under a calendar that needsTemporal).