You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(calendar): do not pass numeric-only text to date constructor
The current code expects parsing on partial input, e.g. 1, to be failed on new Date("1").
However, there are incosintency between browsers on how new Date consturctor or Date.parse works.
input Chrome Firefox
new Date("1") success invalid
new Date("10") success invalid
new Date("100") success invalid
new Date("1000") success success
On Chrome, new Date("1") or such can create instance of Date.
So, getDate is a number, then hour is not chosen correctly.
This PR adds a check input is number-only `^[0-9]+$ or not.
If input is number-only, it should go to time-only or date-only logic.
0 commit comments