-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug Report] Dete Picker bug caused by API of setMonth () #6129
Comments
Translation of this issue: EnvironmentWindows 10/chrome/2.6.10 Reproduction link
Steps to reproduceSwitch to February-March What is expected?Expect February on the left and March on the right. What is actually happening?March on the left and March on the rightAs for the use of the above code, when switching to March, there will be a bug, and eventually found that the problem may be caused by the setMonth of JS itself. I have tried several browsers, all of which have such problems. API error?Let current = new Date ()
Current. setMonth (2)
Console. log (current)// Here is the correct setting for March
Current. setMonth (1)
Console. log (current)// / The wrong setting here was March, which is expected to be February, causing component errors
` ` ` `
# Problem Repair
` ` ` `
// date-range: 299
Panel ==='left'
Current [`set $](current [`get $]() increment)
Current [`set $](current [`get $]() increment);
` ` ` ` |
目前已知并非是api的bug,是由于setMonth在空缺日参数只接受月参数的时候,会自动沿用当前时间的日参数,今天是29号,setMonth(1)=>setMonth(1,29)=>2月29=>3月1,从而导致了日期组件的出错 |
Environment
windows10/chrome/2.6.10
Reproduction link
https://run.iviewui.com/9jlYhY9H
Steps to reproduce
切换到2~3月份
What is expected?
期望左侧2月份,右侧3月份
What is actually happening?
左侧3月份,右侧3月份
关于以上代码使用,当切换到3月份时会出现bug,最终发现可能是js本身的setMonth导致的问题,我试了几个浏览器,都有这样的问题。
继而我查看了MDN,也未见提及setMonth有什么特殊,目前不确定是我理解不正确还是该API本来就这样,但组件是由于这个API出现了实实在在的问题。
api出错?
问题修复
The text was updated successfully, but these errors were encountered: