Fix value from null

This commit is contained in:
Adria Navarro 2024-05-21 16:52:40 +02:00
parent 7ebdb0fbcc
commit d93a9e2c4f
1 changed files with 2 additions and 1 deletions

View File

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