Added datepicker to view filters

This commit is contained in:
Michael Shanks 2020-10-01 17:07:53 +01:00
parent 27015ebd17
commit 3daaf88a74
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