2021-04-20 21:06:27 +02:00
|
|
|
<script>
|
|
|
|
import Field from "./Field.svelte"
|
|
|
|
import DatePicker from "./Core/DatePicker.svelte"
|
|
|
|
import { createEventDispatcher } from "svelte"
|
|
|
|
|
|
|
|
export let value = null
|
|
|
|
export let label = null
|
|
|
|
export let labelPosition = "above"
|
|
|
|
export let disabled = false
|
|
|
|
export let error = null
|
|
|
|
export let enableTime = true
|
|
|
|
export let placeholder = null
|
|
|
|
|
|
|
|
const dispatch = createEventDispatcher()
|
|
|
|
const onChange = e => {
|
2021-08-10 18:41:11 +02:00
|
|
|
const isoString = e.detail.toISOString()
|
|
|
|
value = isoString
|
|
|
|
dispatch("change", isoString)
|
2021-04-20 21:06:27 +02:00
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
2021-04-29 16:24:59 +02:00
|
|
|
<Field {label} {labelPosition} {error}>
|
2021-04-20 21:06:27 +02:00
|
|
|
<DatePicker
|
|
|
|
{error}
|
|
|
|
{disabled}
|
|
|
|
{value}
|
|
|
|
{placeholder}
|
|
|
|
{enableTime}
|
2021-05-04 12:04:42 +02:00
|
|
|
on:change={onChange}
|
|
|
|
/>
|
2021-04-20 21:06:27 +02:00
|
|
|
</Field>
|