Skip to content

fix(InputNumber/InputDate/InputTime/Calendar): restore locale prop#6546

Merged
benjamincanac merged 1 commit into
v4from
feat/restore-locale-prop
Jun 3, 2026
Merged

fix(InputNumber/InputDate/InputTime/Calendar): restore locale prop#6546
benjamincanac merged 1 commit into
v4from
feat/restore-locale-prop

Conversation

@benjamincanac
Copy link
Copy Markdown
Member

🔗 Linked issue

Resolves #6542

❓ Type of change

  • 📖 Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

Restores the locale prop on the components that wrap locale-aware Reka roots, so a single field can be localized narrowly without changing the whole app's locale (e.g. a coordinates input that needs a . decimal separator while the app runs in ru).

The prop was dropped from these components via Omit<..., 'locale'>. Re-adding it is enough since they already forward props through useForwardProps. Reka's useLocale resolves locale?.value || context.locale || "en", so when the prop is undefined it falls back to the global UApp / ConfigProvider locale.

  • InputNumberNumberFieldRoot
  • InputDateDateFieldRoot / DateRangeFieldRoot
  • InputTimeTimeFieldRoot / TimeRangeFieldRoot
  • CalendarCalendarRoot / RangeCalendarRoot (also used for week-number formatting via props.locale ?? locale.code)

ColorPicker doesn't need it, it's a custom Primitive-based implementation that doesn't wrap ColorFieldRoot.

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

Re-expose the `locale` prop on components wrapping locale-aware Reka roots
so a single input can be localized without changing the global locale.
When undefined, it falls back to the `UApp` / `ConfigProvider` locale.

Resolves #6542
@benjamincanac benjamincanac force-pushed the feat/restore-locale-prop branch from d5a2ef5 to b121815 Compare June 3, 2026 13:15
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 3, 2026

Review Change Stack

📝 Walkthrough

Walkthrough

This PR restores locale prop support across four input components: Calendar, InputDate, InputNumber, and InputTime. For each component, the internal type definitions are updated to remove locale from the Omit exclusion lists, exposing it as a public prop. Calendar includes an additional runtime change where week number rendering now prefers props.locale when provided, falling back to the resolved locale code. InputNumber adds runtime forwarding logic to pass the locale prop to the underlying NumberFieldRoot.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description check ✅ Passed The description is well-detailed and directly related to the changeset, explaining the purpose, affected components, implementation approach, and the fallback behavior.
Linked Issues check ✅ Passed The PR fully addresses issue #6542 by restoring the locale prop to InputNumber and related components (InputDate, InputTime, Calendar), with proper fallback to global locale when undefined.
Out of Scope Changes check ✅ Passed All changes are within scope—modifying prop type definitions across four components to expose locale, with no unrelated alterations to logic or other components.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title clearly and concisely summarizes the main change: restoring the locale prop across four components (InputNumber, InputDate, InputTime, Calendar).

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/restore-locale-prop

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.

@benjamincanac benjamincanac changed the title feat(InputNumber/InputDate/InputTime/Calendar): restore locale prop fix(InputNumber/InputDate/InputTime/Calendar): restore locale prop Jun 3, 2026
@github-actions github-actions Bot added the v4 #4488 label Jun 3, 2026
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Jun 3, 2026

npm i https://pkg.pr.new/@nuxt/ui@6546

commit: b121815

@benjamincanac benjamincanac changed the title fix(InputNumber/InputDate/InputTime/Calendar): restore locale prop fix(InputNumber/InputDate/InputTime/Calendar): restore locale prop Jun 3, 2026
@benjamincanac benjamincanac merged commit ed2f955 into v4 Jun 3, 2026
24 checks passed
@benjamincanac benjamincanac deleted the feat/restore-locale-prop branch June 3, 2026 15:29
@lukas-pierce
Copy link
Copy Markdown

@benjamincanac Thank you!

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

Labels

v4 #4488

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Restore locale prop support for InputNumber

2 participants