iamkun / iamkun/dayjs

antd使用自定义组件替换成dayjs后,会改变DatePicker默认的行为

Open
#1,999 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
48.7k
Forks
2.5k
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
momentjs替换成dayjs后,datePicker手动删除时间的某一位会自动补0且光标回到最后一位,导致datePicker使用体验十分不佳

![6cuh7-mgutb](https://user-images.githubusercontent.com/21034137/180769576-d5eb6a04-7fd4-41d4-834b-176ad7fbcc71.gif)

**Expected behavior**
同默认momentjs一致,不自动补0且光标不移动

**Information**
- "dayjs": "^1.9.6",
- "antd": "^4.18.2",

Contributor guide

Open the contributing guide

Research direction

Reproduce the behavior with antd 4.18.2's DatePicker and dayjs 1.9.6, using the linked recording as the reference; compare it with the default moment.js behavior. The issue is done when manually deleting one digit does not automatically insert 0 and the cursor does not move to the final position.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.