Skip to content

fix(Calendar): day and week numbers use the locale's digits - #9610

Merged
nynexman4464 merged 3 commits into
mainfrom
nynexman4464/fix/calendar-day-digits
Nov 3, 2026
Merged

nynexman4464 merged 3 commits into
mainfrom
nynexman4464/fix/calendar-day-digits

Conversation

@nynexman4464

@nynexman4464 nynexman4464 commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

User impact

Under a locale whose numbering system is not Latin, such as fa-IR or ar-EG, Calendar's month heading shows the locale's digits (اکتبر ۲۰۲۶), but the day cells and week numbers show 1 2 3…. The touch calendar's month panes in DateInput do the same. People reading Persian or Arabic-Indic digits get a mixed grid, and the day numbers do not match the heading above them.

Problem and solution fit

  • Why it occurs: day and week numbers render as raw JavaScript numbers. Only the month heading goes through a locale formatter.
  • Why it harms the task: a grid of digits that differ from the heading and from the rest of the page is harder to scan and looks broken.
  • Why it matters: the heading already follows the locale's digits, which are part of the locale contract.

A shared date helper now formats a day or week number in the provider locale's digits. Calendar's grid and the touch month panes use it.

Expected behavior and authority

  • component:Calendar FR1: "Day and week numbers MUST use the locale's digits (architecture:internationalization INV8)." The record listed the ASCII digits as an implementation gap. This PR removes that gap from FR1, the contract table, and Current-state impact, and adds the new test to the verification map.
  • architecture:internationalization: INV8 puts locale-sensitive formatting in shared helpers, and INV10 says a locale changes numbering, not the calendar.

Smallest restoration

  • A new internal helper in utils/plainDate.ts formats the number with Intl.NumberFormat, using the explicit locale and no grouping. The component does not call Intl itself.
  • Only the digits change. Each number stays the Gregorian day or ISO week, including in fa-IR, whose date formatters default to the Persian calendar.
  • English output is unchanged. No public API changes.

Evidence

  • Reproduction before the change (Chromium, Storybook): under fa-IR and ar-EG, October 15, 2026 renders as 15 in Calendar and in the touch month pane.
  • Result after the change: ۱۵ under fa-IR and ١٥ under ar-EG, in both places. Week numbers follow the same digits.
  • Representative unchanged path: en still renders 15, and week numbers stay 40–44.
  • Regression proof: Calendar.test.tsx and DateInputTouch.test.tsx locale-digit cases, and plainDate.test.ts helper cases, including the Gregorian day under fa-IR. The fa and ar cases fail with the rendering change reverted.

Writing rubric results

  • R1 narration: none. Three implementation-gap statements were removed; nothing was added that describes the change.
  • R2 research in the record: none.
  • R3 evidence naming a change: none. The verification map names the new test case, and the mutation column states what fails.
  • R4 rejected alternatives: none.
  • R5 pull request or issue references: none added.
  • R6 ruled open questions: none touched.

Screenshots

Real Chromium against Storybook, October 2026 with week numbers.

Before After
fa-IR fa-IR before fa-IR after
ar-EG ar-EG before ar-EG after
fa-IR, touch month pane touch before touch after

en is unchanged:

en after

Scope

  • One defect is restored.
  • Separable contradictory or unsettled tagalongs were removed or split.
  • No new public API, visual representation, default, or interaction model is hidden under the bug-fix label.
  • Public text and artifacts contain no internal Meta context.

Testing

  • pnpm exec vitest run --project ui packages/core/src/Calendar packages/core/src/utils/plainDate.test.ts packages/core/src/DateInput: 700 passed.
  • pnpm check:knowledge: passes.
  • Real Chromium (Playwright) against Storybook: Calendar with week numbers, and the touch month pane in a mobile viewport with touch, under fa-IR, ar-EG, and en.

@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 3, 2026 6:56pm 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 3, 2026, 6:59 PM UTC

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

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 717fd25

Storybook · Sandbox · built from this PR's head

Modified components

Component Size LoC Visual · A11y · RTL
DateRangeInput 72.1 kB (+79 B) · 11.9 kB CSS (0) — — · — · —
DateInput · Storybook 106.0 kB (+62 B) · 15.4 kB CSS (0) 3,791 (+3) ✓ · ✓ · ✓
DateTimeInput 162.6 kB (+58 B) · 17.1 kB CSS (0) — — · — · —
7 more components
Component Size LoC Visual · A11y · RTL
Calendar · Storybook 54.7 kB (+57 B) · 10.4 kB CSS (0) 1,649 (+3) ✓ · ✓ · ✓
PowerSearch 194.4 kB (+50 B) · 21.6 kB CSS (0) — — · — · —
lab/MobilePowerSearch 218.8 kB (+44 B) · 1.2 kB CSS (0) — — · — · —
Timestamp 21.3 kB (+1 B) · 10.0 kB CSS (0) — — · — · —
lab/Comments 259.2 kB (0) · 2.5 kB CSS (0) — — · — · —
lab/CommentThread 254.1 kB (0) · 2.4 kB CSS (0) — — · — · —
lab/Schedule 62.0 kB (−1 B) · 3.9 kB CSS (0) — — · — · —

Package size: @astryxdesign/core 6.23 MB packed (+469 B); no new dependencies.

API changes: none in this pull request

Committed API report behind this build: core 2 rows; run pnpm api:report.

Touched components checked; add ci:run-visual, ci:run-a11y or ci:run-rtl to run the full suites.

Current run: CI concluded cancelled; parts of this report may be missing.


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.

Looks good: Calendar's day and week numbers and the touch month panes now use the locale's digits through one shared helper, as component:Calendar FR1 requires, and the new fa-IR and ar-EG test cases fail without the change. The remaining step is the repository's spec-owner gate for the record edit: an engineering owner (you can do this yourself) comments /approve-spec with the head SHA.

[Automated review]

@nynexman4464

Copy link
Copy Markdown
Contributor Author

/approve-spec a9a20c4

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 3, 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.

Looks good: Calendar's day and week numbers, and the touch month panes, now use the locale's digits through one shared helper, as the Calendar contract (FR1) requires. The new fa-IR and ar-EG cases fail without the change and pass with it, and Latin-digit locales render as before. No changes are needed.

[Automated review]

@nynexman4464
nynexman4464 merged commit 984eab7 into main Nov 3, 2026
141 of 145 checks passed
@github-actions
github-actions Bot deleted the nynexman4464/fix/calendar-day-digits branch November 4, 2026 06:04

This branch was successfully deployed

1 active deployment
Preview — 717fd252 Deployed Nov 3, 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.

1 participant