fix: parse Day.js input with the picker locale - #1013
Conversation
|
@nrps9909 is attempting to deploy a commit to the afc163's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review. Walkthrough本次变更调整 Day.js 的区域解析方式,保留未注册区域的回退行为,并增加生成器与日期选择器的法语解析测试。测试同时验证严格校验和全局 locale 不变。 ChangesDay.js 区域解析
日期选择器本地化输入
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to Localized picker input is now parsed with the picker locale without changing Day.js’s global locale. The covered parsing and picker submission behavior indicates no remaining merge-blocking risk. Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
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. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1013 +/- ##
=======================================
Coverage 98.88% 98.88%
=======================================
Files 68 68
Lines 2867 2867
Branches 822 822
=======================================
Hits 2835 2835
Misses 29 29
Partials 3 3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
With Day.js globally set to English, a French picker using
D MMM YYYYdisplays24 août 2026, but editing it to25 août 2026and pressing Enter does not commit the value. The adapter parses with the global language and only assigns the requested locale afterward.Resolve the effective picker locale before strict parsing and pass it to Day.js as a parsing argument. Resolve it through a Day.js instance so an unregistered locale keeps the existing global-language fallback. Parsing never changes the global language.
This addresses the adapter-side input issue described in the review of ant-design/ant-design#59222. It does not change locale registration or the separate Uzbek locale issue.
Validation against base
a975a11f9a959a811b1ecd901e8ff8ae8f0e515b:fr_BEmapping, alternate formats, English input with a French global language, and a rendered picker keyboard-edit/Enter interaction.tests/picker.spec.tsx.lint:tscreports ten existing deprecated Jest matcher-alias errors in unchanged picker tests. A clean worktree at the base with the same dependencies produces the same ten diagnostics after accounting for inserted-line offsets. No new type errors are introduced; this is not a claim of a clean full-repository type check.Implemented and validated with OpenAI Codex assistance.
Summary by CodeRabbit