Added datepicker to view filters

This commit is contained in:
Michael Shanks 2020-10-01 17:07:53 +01:00
parent 0c373a9fb4
commit 2d80b2be3d
1 changed files with 9 additions and 0 deletions

View File

@ -6,6 +6,7 @@
Icon,
Input,
Select,
DatePicker,
} from "@budibase/bbui"
import { backendUiStore } from "builderStore"
import { notifier } from "builderStore/store/notifications"
@ -93,6 +94,10 @@
? viewModel.schema[field].constraints.inclusion
: [true, false]
}
function isDate(field) {
return viewModel.schema[field].type === "datetime"
}
</script>
<div bind:this={anchor}>
@ -137,6 +142,10 @@
<option value={option}>{option.toString()}</option>
{/each}
</Select>
{:else if filter.key && isDate(filter.key)}
<DatePicker
bind:value={filter.value}
placeholder={filter.key || fields[0]} />
{:else}
<Input
thin