Skip to content

Commit f4440c5

Browse files
committed
Date validation on input was broken - Number.isNaN('Invalid Date') returns false, unlike isNaN('Invalid Date')
1 parent 4e5ca2b commit f4440c5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

js/src/date-range-picker.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ class DateRangePicker extends BaseComponent {
346346
const date = this._parseDate(event.target.value)
347347

348348
// valid date or empty date
349-
if ((date instanceof Date && !Number.isNaN(date)) || (date === null)) {
349+
if ((date instanceof Date && !isNaN(date)) || (date === null)) {
350350
this._startDate = date
351351
this._calendarDate = date
352352
this._calendar.update(this._getCalendarConfig())
@@ -388,7 +388,7 @@ class DateRangePicker extends BaseComponent {
388388
const date = this._parseDate(event.target.value)
389389

390390
// valid date or empty date
391-
if ((date instanceof Date && !Number.isNaN(date)) || (date === null)) {
391+
if ((date instanceof Date && !isNaN(date)) || (date === null)) {
392392
this._endDate = date
393393
this._calendarDate = date
394394
this._calendar.update(this._getCalendarConfig())

0 commit comments

Comments
 (0)