Skip to content

feat(Timestamp, PowerSearch): write dates in the provider's calendar - #9639

Merged
nynexman4464 merged 12 commits into
mainfrom
nynexman4464/feat/calendar-formatters
Nov 5, 2026
Merged

nynexman4464 merged 12 commits into
mainfrom
nynexman4464/feat/calendar-formatters

Conversation

@nynexman4464

@nynexman4464 nynexman4464 commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Base is main (#9791 and #9622 are merged).

PowerSearch editor gap ships documented: the value editor a date token opens is a DateInput (a DateRangeInput for a range), and it shows Gregorian dates until DateInput follows the provider's calendar. The PowerSearch record states it as an implementation gap, and the PowerSearch docs and the changeset say so.

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" (or hebrew, buddhist, …) on InternationalizationProvider gets Persian dates in Calendar. 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

  • Timestamp: the date, date_long, date_weekday and date_time formats, the hover card's full date and its tooltipEntries rows, and the relative accessible name use the provider's resolved calendar. time, relative, system_* and unix_seconds don't change. The placeholder that clock formats render before hydration (date_time in UTC) stays Gregorian, so server and client write the same text with or without Temporal.
  • PowerSearch: date_absolute values use it: the token in both presentations, the sheet's Filters rows and removal announcement, and PowerSearchToken. Filter values stay Unix seconds. The value editor a date token opens, a DateInput or DateRangeInput, shows the calendar that input resolves, which is Gregorian: under calendar="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.
  • Pure helpers keep a Gregorian default and take an optional trailing calendar: formatSharedDate, formatFilterValue, and shortDate/monthYear in @astryxdesign/charts and Lab Chart. PowerSearch and PowerSearchToken pass their resolved calendar to formatFilterValue; no Astryx component calls formatSharedDate or the chart formatters with a calendar.
  • plainDateFormat with a calendar option other than gregory goes through Core's calendar labels and names the month and day that Calendar shows. Without Temporal it keeps Intl's output for that calendar.
  • Schedule (Lab) and the internal calendar-system entry 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-111 FR18, together with FR2 (component prop, then provider prop, then gregory), FR5 (calendars that need Temporal) and DEC-2 (a locale never selects the calendar).
  • architecture:internationalization INV8–INV10, with INV10 as the base branch states it.
  • spec:AST-013 FR12: the Timestamp and PowerSearch records add the browser-support exception for calendars that need Temporal, as Calendar and the date inputs do.

Public delta and caller burden

  • No new prop. Without a provider calendar, every output stays the same. A provider locale with a -u-ca- keyword, such as th-TH-u-ca-buddhist, keeps Gregorian dates; set the provider's calendar to choose one.
  • Additive arguments, each defaulting to 'gregory': formatSharedDate(pd, format, locale?, calendar?), formatFilterValue(…, timezoneID?, calendar?), shortDate(value, locale, calendar?) and monthYear(value, locale, calendar?).
// before
<InternationalizationProvider locale="en" calendar="persian">
  <Timestamp value={iso} format="date_long" /> {/* October 30, 2026 */}
</InternationalizationProvider>
// after
{/* Aban 8, 1405 AP */}
  • Charts: chart formatters have no provider access and no Astryx call site, so an application passes its calendar itself. shortDate and monthYear with a calendar other than gregory go through plainDateFormat.
  • PowerSearch date editor: stays Gregorian, as above; the PowerSearch docs and the changeset say so.
  • Calendars that need Temporal: where the runtime lacks it, Timestamp and PowerSearch show Gregorian dates and warn in development, as Calendar does.

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 that Calendar shows, also where Intl and Temporal disagree on a month start in the Chinese or Dangi calendar. Times come from Intl. An instant formatted in the host's zone gets a formatter built for the call (the internal dateTimeFormatAtCall in plainDate.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:

  • Native Temporal: Timestamp, the PowerSearch token and Calendar all show Aban 1405, and system_date_time stays 2026-10-30 12:00:00.
  • Temporal removed: Gregorian dates, plus the development warning.
  • Temporal removed, polyfill loaded: the same as native.

Screenshots

State Screenshot
Chromium, provider calendar="persian", English panel en
Chromium, provider calendar="persian", fa-IR panel fa-IR
Chromium without Temporal: Gregorian fallback no temporal
WebKit (Safari 26.5) with the polyfill webkit

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=2 over the test files this pull request changes and the tests beside its changed sources (Timestamp, PowerSearch, Calendar, i18n, utils, and the charts and Lab Chart formatters) plus docPropLiterals.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 the main commit the stack sits on (d23d1fe438). The last commit changes only the PowerSearch record, its docs and the changeset; docPropLiterals.test.ts passes on it (20 tests).
  • Test matrix:
    • persian, hebrew and buddhist, each under en and the native locale;
    • Gregorian defaults, with system_* and time unchanged; iso8601 written as gregory;
    • a chinese date where Intl and Temporal disagree on the month start, with and without a time;
    • the no-Temporal fallback, with buddhist still working, and a clock format server-rendered without Temporal that hydrates;
    • a host zone change between two calls, which moves both the date and the time;
    • Timestamp under a provider calendar, a -u-ca- locale that keeps Gregorian dates, and a bare fa-IR.
  • tsc --noEmit is clean for core, lab and charts (lab and charts after a fresh core build).
  • pnpm check:knowledge and pnpm check:changesets pass.
  • node scripts/pre-review.mjs --base main: 1,698 authored lines.

Writing rubric results

component:Timestamp:

  • R1 narration: none. FR2, FR3, the compatibility class and the contract table describe behavior in the present tense.
  • R2 research: none.
  • R3 evidence: the verification cells name test suites and states, not pull requests. The new spec:AST-013 FR12 exception names its evidence and its gap (no real-browser run, and no hydration test of an absolute date format, under a calendar that needs Temporal).
  • R4 rejected alternatives: none added.
  • R5 change references: none.
  • R6 open questions: none.

component:PowerSearch:

  • R1 narration: none. The new compatibility line, its implementation gap (a date value's editor is a DateInput, or a DateRangeInput for a date_range value, and shows Gregorian dates), and the spec:AST-013 FR12 exception describe behavior in the present tense.
  • R2 research: none.
  • R3 evidence: names PowerSearch.calendarSystems.test.tsx and a PowerSearchBottomSheet.test.tsx case, and states the gap (no real-browser run, and no server render and hydration test, under a calendar that needs Temporal).
  • R4 rejected alternatives: none.
  • R5 change references: none.
  • R6 open questions: none affected.

@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 12:36am 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
🟢 Reviewed (for maintainers only) Nov 5, 2026, 12:51 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.

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 Temporal but the browser has it (Timestamp.tsx:367, Timestamp FR3); keep the pre-hydration placeholder Gregorian.
  • Schedule's isSameCalendarMonth works out calendar months a second way; re-export Core's calendarMonthOf through 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}

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 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.

Comment thread packages/lab/src/Schedule/shared.tsx Outdated

// A Gregorian month or year can span two months or years of another calendar,
// so ranges compare the calendar's own fields.
function isSameCalendarMonth(

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.

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.

Comment thread packages/charts/src/formatters.ts Outdated
calendar: 'gregory',
}),
);
/** One date formatter per locale and calendar. */

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: this comment restates byLocaleAndCalendar. Delete it.

@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.

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 Temporal but the browser has it (Timestamp.tsx:367, Timestamp FR3), so keep the pre-hydration placeholder Gregorian and state the both-sides-Temporal condition next to FR3's zone gap.
  • Under chinese and dangi, Timestamp, PowerSearch and Schedule write dates with raw Intl while Calendar uses Core's formatCalendarDate, so Gregorian 2027-02-06 is day 1 of First Month in Calendar but the 30th of Twelfth Month beside it; route these labels, and Schedule's isSameCalendarMonth, through Core's calendar helpers.
  • InternationalizationProvider's docs and record at this head still say the provider calendar reaches only Calendar, 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}

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 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.

Comment thread packages/lab/src/Schedule/shared.tsx Outdated

// A Gregorian month or year can span two months or years of another calendar,
// so ranges compare the calendar's own fields.
function isSameCalendarMonth(

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.

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.

Comment thread packages/charts/src/formatters.ts Outdated
calendar: 'gregory',
}),
);
/** One date formatter per locale and calendar. */

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: this comment restates byLocaleAndCalendar; delete it.

@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.

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 Temporal fails 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 have Temporal or both lack it.
  • Under chinese and dangi, Timestamp, PowerSearch and Schedule write dates with raw Intl while Calendar uses Core's formatCalendarDate, so with native Temporal Gregorian 2027-02-06 is day 1 of First Month in Calendar but the 30th of Twelfth Month beside it; route these labels, and Schedule's isSameCalendarMonth, through Core's calendar helpers.
  • The InternationalizationProvider docs and prop description still say the calendar is what Calendar shows, 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}

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 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,

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.

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.

Comment thread packages/lab/src/Schedule/shared.tsx Outdated

// A Gregorian month or year can span two months or years of another calendar,
// so ranges compare the calendar's own fields.
function isSameCalendarMonth(

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.

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.",

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 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.

Comment thread packages/charts/src/formatters.ts Outdated
calendar: 'gregory',
}),
);
/** One date formatter per locale and calendar. */

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: this comment restates byLocaleAndCalendar; delete it.

@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.

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 Temporal fails 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 have Temporal or both lack it.
  • Under chinese and dangi, Timestamp, PowerSearch and Schedule write dates with raw Intl while Calendar uses Core's formatCalendarDate, so with native Temporal Gregorian 2027-02-06 is day 1 of First Month in Calendar but the 30th of Twelfth Month beside it; route these labels, and Schedule's isSameCalendarMonth, through Core's calendar helpers.
  • The InternationalizationProvider docs and prop description still say the calendar is what Calendar shows, 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 formatSharedDate and that a Timestamp and a Calendar always agree, so narrow that wording.

[Automated review]

@imdreamrunner

Copy link
Copy Markdown
Contributor

Heads-up: #9790 removed packages/lab/src/MobilePowerSearch from main (Core's PowerSearch now ships that touch flow), so the hunks under that directory can be dropped when this rebases.

@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.

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 chinese and dangi, Timestamp, PowerSearch and Schedule write dates with raw Intl while Calendar uses Core's formatCalendarDate, so in Chromium with native Temporal Gregorian 2027-02-06 is day 1 of First Month in Calendar but the 30th of Twelfth Month beside it, and Schedule's isSameCalendarMonth splits Gregorian January 1989 under japanese where Core's calendarMonthOf does not; route these labels through Core's calendar helpers.
  • The InternationalizationProvider docs and prop description still say the calendar is what Calendar shows, 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 formatSharedDate and that a Timestamp and a Calendar always agree, so narrow that wording.

[Automated review]

...SHARED_DATE_FORMAT_OPTIONS.date_long,
...zone,
calendar: 'gregory',
calendar,

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.

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.

Comment thread packages/lab/src/Schedule/shared.tsx Outdated

// A Gregorian month or year can span two months or years of another calendar,
// so ranges compare the calendar's own fields.
function isSameCalendarMonth(

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.

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.

Comment thread packages/charts/src/formatters.ts Outdated
calendar: 'gregory',
}),
);
/** One date formatter per locale and calendar. */

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: this comment restates byLocaleAndCalendar; delete it.

@nynexman4464
nynexman4464 force-pushed the nynexman4464/feat/calendar-systems-core branch from 53da574 to fe3c951 Compare November 3, 2026 22:39
@nynexman4464
nynexman4464 force-pushed the nynexman4464/feat/calendar-formatters branch from 48a3e9e to 6c500c9 Compare November 3, 2026 22:40

@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.

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_time and 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 to Intl instead of through Core's calendar labels, so under calendar="iso8601" date_time reads "2026 Oct 30, 12:00 PM" in Chromium and loses its month in Node 24 while date_long and Calendar read "October 30, 2026", and Chinese and Korean dates in formatSharedDate and Schedule's ranges can name another day than Calendar; route them through one Core helper that applies labelCalendar and Temporal's day, and add iso8601 to the tests.
  • The title names charts, whose formatters never read the provider, and the body says Astryx call sites pass the calendar to formatSharedDate and 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,

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.

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},

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.

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.

Comment thread packages/lab/src/Schedule/shared.tsx Outdated
year: 'numeric',
timeZone: timezoneID,
calendar: 'gregory',
calendar,

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.

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,

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 (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."

Comment thread packages/lab/src/Schedule/shared.tsx Outdated
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

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 (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."

@nynexman4464 nynexman4464 changed the title feat(Timestamp, PowerSearch, Schedule, charts): built-in date formats follow the provider's calendar feat(Timestamp, PowerSearch, Schedule): write dates in the provider's calendar Nov 3, 2026
@nynexman4464
nynexman4464 force-pushed the nynexman4464/feat/calendar-systems-core branch from fe3c951 to 0041c70 Compare November 4, 2026 18:42
@nynexman4464
nynexman4464 force-pushed the nynexman4464/feat/calendar-formatters branch from 6c500c9 to 3a9bb8b Compare November 4, 2026 18:42
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.
…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.
@nynexman4464
nynexman4464 force-pushed the nynexman4464/feat/calendar-formatters branch from 6ebed8d to 396e07d Compare November 4, 2026 23:15
@nynexman4464
nynexman4464 changed the base branch from nynexman4464/feat/calendar-systems-core to main November 4, 2026 23:15
@nynexman4464 nynexman4464 reopened this Nov 4, 2026
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 4, 2026
@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 1c5596f

Storybook · Sandbox · built from this PR's head

Modified components

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) before frame after frame diff frame
Calendar · Default (neutral, dark) before frame after frame diff frame

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

@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.

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 under calendar="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

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.

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?

@nynexman4464

Copy link
Copy Markdown
Contributor Author

/approve-spec 396e07d

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 4, 2026
github-actions Bot added a commit that referenced this pull request Nov 4, 2026
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.
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 5, 2026
@nynexman4464

Copy link
Copy Markdown
Contributor Author

/approve-spec 1c5596f

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 5, 2026

@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.

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

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: 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.

github-actions Bot added a commit that referenced this pull request Nov 5, 2026
@nynexman4464
nynexman4464 merged commit edf7128 into main Nov 5, 2026
64 checks passed
@github-actions
github-actions Bot deleted the nynexman4464/feat/calendar-formatters branch November 5, 2026 06:03

This branch was successfully deployed

1 active deployment
Preview — 1c5596f4 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants