2019-07-13 11:35:57 +02:00
|
|
|
<script>
|
2020-09-08 19:03:41 +02:00
|
|
|
// import flatpickr from "flatpickr"
|
|
|
|
// import "flatpickr/dist/flatpickr.css"
|
|
|
|
// import { onMount } from "svelte"
|
2020-09-01 23:00:30 +02:00
|
|
|
import { Label, Input } from "@budibase/bbui"
|
2019-07-13 11:35:57 +02:00
|
|
|
|
2020-02-03 10:50:30 +01:00
|
|
|
export let label
|
2020-09-08 19:03:41 +02:00
|
|
|
export let datetime
|
2019-07-13 11:35:57 +02:00
|
|
|
|
2020-09-08 19:03:41 +02:00
|
|
|
let date = datetime.substring(0, 10)
|
|
|
|
let time = datetime.substring(11, 16)
|
2019-08-07 10:03:49 +02:00
|
|
|
|
2020-09-08 19:03:41 +02:00
|
|
|
$: console.log({ datetime, date, time })
|
2019-07-13 11:35:57 +02:00
|
|
|
|
2020-09-08 19:03:41 +02:00
|
|
|
// TODO: update to use proper date parsing logic - dayJS or similar
|
|
|
|
$: datetime = `${date}T${time}:00.000Z`
|
2019-07-13 11:35:57 +02:00
|
|
|
</script>
|
|
|
|
|
2020-08-22 22:34:46 +02:00
|
|
|
<div class="bb-margin-m">
|
2020-09-01 22:28:38 +02:00
|
|
|
<Label small forAttr={'datepicker-label'}>{label}</Label>
|
2020-09-08 19:03:41 +02:00
|
|
|
<input type="date" bind:value={date} />
|
|
|
|
<input type="time" bind:value={time} />
|
|
|
|
</div>
|