Picker with Luxon config raises "Error: Invalid DateTime: unparsable: the input "2023-1-01" can't be parsed as format yyyy-MM-dd"
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 48/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- react, typescript
- 领域
- frontend
调研方向
从 src/generate/luxon.ts 开始,在启用 Luxon's Settings.throwOnInvalid 的情况下复现 month-picker 的场景,重点关注 issue 中引用的 parsing 格式。当 picker 对带 padding 和不带 padding 的月份输入都不再抛出错误,同时保留现有的日期行为时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
rc-picker version: 3.8.1
antd version: 5.6.0
luxon version: 3.3.0
When we set the luxon config to Settings.throwOnInvalid = true we get an error when we open up the antd date range picker (using "month" picker)
I don't deeply understand the rc-picker code, but a few things stuck out to me:
the luxon code is parsing using a "yyyy-MM-dd" format while dayjs seems to allow for both padded and non-padded month ['YYYY-M-DD', 'YYYY-MM-DD']
This doesn't really cause issues if we ignore the error, so our workaround is to change that throwOnInvalid setting, but we would strongly prefer for parsing errors to throw. This may be an issue with antd's picker and could raise the issue there if you think that's better, but I do think the config generation for different libraries should have the same behavior. If dayjs accepts that format, then it seems like luxon also should accept it. I did a quick test and I believe "yyyy-M-dd" will work for both 2023-1-01 and 2023-01-01 cases, so that is potentially a simple fix if this doesn't have other side effects.
- 主要语言
- TypeScript
- 星标
- 304
- 派生
- 349
- 平均合并
- 43 分钟
- 30 天内合并 PR
- 1
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
react-component/picker 的其他 Issue
-
Disabled date entered manually is not reverted on blur可能已有人在做 @Ye-YiChen 于 5 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 68/100
react-component/picker#1018 · 2 条评论 ·
-
enter date manually in format YY prevent the user to add YYYY可能已有人在做 @nrps9909 于 50 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 48/100
react-component/picker#956 · 1 条评论 · 1 个 reaction ·
-
难度 4/5 3-5 天 新手友好度 30/100
react-component/picker#955 · 1 条评论 · 1 个 reaction ·
-
[Bug / DX]: Deep imports for generateConfig are incompatible with pnpm and break module resolution可能已有人在做 @DanielChutkowskiJMMJ 于 332 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 58/100
react-component/picker#949 ·
-
DatePicker does not trigger onChange when manually clearing input text可能已有人在做 @nrps9909 于 50 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 55/100
react-component/picker#946 ·
查看 react-component/picker 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 73/100
anomalyco/opencode#56380 · 1 条评论 ·
维护者通常 1 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 72/100
-
BUG | `MCP 服务器` | 全局层行的停用/启用与删除报 404 server row not found,编辑保存会在 profile 层复制出重复行可能已有人在做 @w6242652 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 2/5 1-3 小时 新手友好度 72/100
Chocobozzz/PeerTube#7832 ·
维护者通常 3 天内回复
-
Pay to use?未关闭
难度 1/5 1 小时以内 新手友好度 66/100
darkreader/darkreader#16108 · 1 条评论 ·
维护者通常 2 天内回复