1
0
Fork 0
mirror of synced 2024-08-23 05:51:29 +12:00

Handle undefineds

This commit is contained in:
Adria Navarro 2024-05-21 11:54:42 +02:00
parent 2b1df81649
commit d97f3b0378

View file

@ -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))
}