Skip to content

fix(datepicker): display raw day numbers for all locales#1667

Open
seojcarlos wants to merge 2 commits intothemesberg:mainfrom
seojcarlos:fix/datepicker-day-locale-1453
Open

fix(datepicker): display raw day numbers for all locales#1667
seojcarlos wants to merge 2 commits intothemesberg:mainfrom
seojcarlos:fix/datepicker-day-locale-1453

Conversation

@seojcarlos
Copy link
Copy Markdown

@seojcarlos seojcarlos commented Apr 11, 2026

Summary

  • Use Date.getDate() instead of Intl.DateTimeFormat({ day: "numeric" }) for calendar day cells
  • Fixes locale suffixes appearing in day numbers (e.g. "1日" in ja-JP, "1일" in ko-KR)
  • Calendar UIs universally display bare numbers — this matches standard datepicker behavior

Changes

  • packages/ui/src/components/Datepicker/Views/Days.tsx: Replace getFormattedDate() call with currentDate.getDate()
  • Remove unused getFormattedDate import

Test plan

  • Verify datepicker renders bare numbers (1-31) for default locale
  • Verify datepicker renders bare numbers for ja-JP, zh-CN, ko-KR locales
  • Verify no visual regression on other datepicker views (months, years)

Fixes #1453

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Refactor

    • Datepicker calendar cells now display plain numeric day values (e.g., "1", "2") instead of locale-formatted day labels that could include language-specific suffixes.
  • Chores

    • Added a patch release entry to mark this Datepicker day-label change.

…strings

For locales like ja-JP, zh-CN, and ko-KR, Intl.DateTimeFormat with
{ day: "numeric" } appends locale-specific suffixes (e.g. "1日" instead
of "1"). Calendar UIs universally display bare numbers, so we use
Date.getDate() directly, which is consistent with standard datepicker
behavior across all locales.

Fixes themesberg#1453

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 11, 2026

🦋 Changeset detected

Latest commit: 9504c55

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
flowbite-react Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 11, 2026

@seojcarlos is attempting to deploy a commit to the Bergside Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 11, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 299bd5cd-846a-4acd-8a15-d9bbd5781d8d

📥 Commits

Reviewing files that changed from the base of the PR and between dd553ba and 9504c55.

📒 Files selected for processing (1)
  • .changeset/datepicker-day-locale.md
✅ Files skipped from review due to trivial changes (1)
  • .changeset/datepicker-day-locale.md

📝 Walkthrough

Walkthrough

The Datepicker day-label rendering was changed to use the native Date.getDate() instead of a locale formatter, so calendar cells now display raw numeric day values rather than locale-formatted strings.

Changes

Cohort / File(s) Summary
Datepicker Day Rendering
packages/ui/src/components/Datepicker/Views/Days.tsx
Replaced getFormattedDate(language, currentDate, { day: "numeric" }) with currentDate.getDate() and removed the getFormattedDate import; day cell rendering now shows raw numeric day values.
Release Notes / Changeset
.changeset/datepicker-day-locale.md
Added a patch changeset describing the Datepicker day-label change and its rationale for a patch release.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • SutuSebastian

Poem

A rabbit counts the days with cheer,
No suffix trailing, crystal clear,
Numbers hop in tidy rows,
A tiny change the calendar knows. 🐇📅

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: replacing locale-formatted day labels with raw numeric day values in the datepicker component.
Linked Issues check ✅ Passed The PR implementation directly addresses issue #1453 by replacing Intl.DateTimeFormat with Date.getDate() to display raw numeric day values without locale-specific suffixes.
Out of Scope Changes check ✅ Passed All changes are scoped to the datepicker day-label rendering fix; no unrelated modifications are present in the changeset.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Request option to Display Only Day Numbers in Datepicker.

1 participant