Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Spin Button Date Picker: Fix unreliable date math test (pull #1639)
* Fix unreliable date math bug * fix: Down arrow test When you get towards the end of the month and try to add a month, Javascript Date objects start to do unexpected things. This is causing failures in the CI for all regression tests run on November 30. This is the issue: ```javascript let date = new Date('10/31/2020'); date.setMonth(date.getMonth + 1); ``` The second line increases the date by one month, resulting in date being December 1st, 2020, because there is no November 31st. The fix is to put the day of the month to the 1st using `date.setDate(1)` before doing any math, because all months have the 1st of the month. Co-authored-by: Nick Schonning <[email protected]>
- Loading branch information