Budibase is an open-source low-code platform for creating internal apps in minutes. Supports PostgreSQL, MySQL, MSSQL, MongoDB, Rest API, Docker, K8s 🚀
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

34 lines
745 B

<script>
import flatpickr from "flatpickr"
import "flatpickr/dist/flatpickr.css"
import { onMount } from "svelte"
export let value
export let label
export let width = "medium"
export let size = "small"
let input
let fpInstance
$: if (fpInstance) fpInstance.setDate(value)
onMount(() => {
fpInstance = flatpickr(input, {})
fpInstance.config.onChange.push(selectedDates => {
if (selectedDates.length > 0) value = new Date(selectedDates[0])
})
return fpInstance
})
</script>
<div class="bb-margin-m">
<label class="uk-form-label">{label}</label>
<div class="uk-form-controls">
<input
class="uk-input uk-form-width-{width} uk-form-{size}"
bind:this={input} />
</div>
</div>