Handle undefineds
This commit is contained in:
parent
2b1df81649
commit
d97f3b0378
|
@ -9,6 +9,11 @@
|
|||
$: displayValue = value?.format("HH:mm")
|
||||
|
||||
const handleChange = e => {
|
||||
if (!e.target.value) {
|
||||
dispatch("change", undefined)
|
||||
return
|
||||
}
|
||||
|
||||
const [hour, minute] = e.target.value.split(":").map(x => parseInt(x))
|
||||
dispatch("change", value.hour(hour).minute(minute))
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue