Fix value from null
This commit is contained in:
parent
7ebdb0fbcc
commit
d93a9e2c4f
|
@ -1,4 +1,5 @@
|
||||||
<script>
|
<script>
|
||||||
|
import dayjs from "dayjs"
|
||||||
import NumberInput from "./NumberInput.svelte"
|
import NumberInput from "./NumberInput.svelte"
|
||||||
import { createEventDispatcher } from "svelte"
|
import { createEventDispatcher } from "svelte"
|
||||||
|
|
||||||
|
@ -15,7 +16,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
const [hour, minute] = e.target.value.split(":").map(x => parseInt(x))
|
const [hour, minute] = e.target.value.split(":").map(x => parseInt(x))
|
||||||
dispatch("change", value.hour(hour).minute(minute))
|
dispatch("change", (value || dayjs()).hour(hour).minute(minute))
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue