Skip to content

Commit 3425c5b

Browse files
committed
fix(TimePicker): isValidTime function has to return a boolean, not a number
1 parent 59e119e commit 3425c5b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

js/src/util/time.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,5 +189,5 @@ export const isAmPm = locale =>
189189
*/
190190
export const isValidTime = time => {
191191
const d = new Date(`1970-01-01 ${time}`)
192-
return d instanceof Date && d.getTime()
192+
return d instanceof Date && !Number.isNaN(d.getTime())
193193
}

0 commit comments

Comments
 (0)