Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information