2020-09-09 18:04:49 +02:00
|
|
|
<script>
|
|
|
|
import { DatePicker } from "@budibase/bbui"
|
2020-11-18 22:06:12 +01:00
|
|
|
import { getContext } from "svelte"
|
|
|
|
|
2020-11-24 12:13:26 +01:00
|
|
|
const { styleable, setBindableValue } = getContext("sdk")
|
2020-11-24 12:02:10 +01:00
|
|
|
const component = getContext("component")
|
2020-09-09 18:04:49 +02:00
|
|
|
|
|
|
|
export let placeholder
|
2020-11-24 12:13:26 +01:00
|
|
|
|
|
|
|
let value
|
|
|
|
$: setBindableValue(value, $component.id)
|
2020-09-09 18:04:49 +02:00
|
|
|
|
|
|
|
function handleChange(event) {
|
2020-11-18 22:06:12 +01:00
|
|
|
const [fullDate] = event.detail
|
|
|
|
value = fullDate
|
2020-09-09 18:04:49 +02:00
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
2020-11-24 12:02:10 +01:00
|
|
|
<div use:styleable={$component.styles}>
|
2020-11-18 22:06:12 +01:00
|
|
|
<DatePicker {placeholder} on:change={handleChange} {value} />
|
|
|
|
</div>
|