2020-09-19 01:16:43 +02:00
|
|
|
<script>
|
|
|
|
import { onMount } from 'svelte'
|
|
|
|
import dayjs from 'dayjs'
|
|
|
|
|
|
|
|
const format = 'YYYY-MM-DD'
|
|
|
|
|
|
|
|
export let name = ''
|
|
|
|
|
|
|
|
export let date = new Date()
|
|
|
|
let internal
|
|
|
|
|
|
|
|
const input = (x) => (internal = dayjs(x).format(format))
|
|
|
|
const output = (x) => (date = dayjs(x, format).toDate())
|
|
|
|
|
|
|
|
$: input(date)
|
|
|
|
$: output(internal)
|
|
|
|
</script>
|
|
|
|
|
2020-09-19 01:30:42 +02:00
|
|
|
<style>
|
|
|
|
input {
|
2020-10-12 00:26:36 +02:00
|
|
|
width: 7rem !important;
|
2020-09-19 01:30:42 +02:00
|
|
|
}
|
|
|
|
</style>
|
|
|
|
|
2020-09-19 01:16:43 +02:00
|
|
|
<input class="form-input input-sm" type="date" bind:value={internal} {name} />
|