Add datepicked data binding and fix mustache rendering for non string values

This commit is contained in:
Andrew Kingston 2020-11-24 11:13:26 +00:00
parent e62fbf8ef7
commit 920ef90e14
2 changed files with 7 additions and 2 deletions

View File

@ -8,6 +8,9 @@ const entityMap = {
">": ">", ">": ">",
} }
mustache.escape = text => { mustache.escape = text => {
if (text == null || typeof text !== "string") {
return text
}
return text.replace(/[<>]/g, function fromEntityMap(s) { return text.replace(/[<>]/g, function fromEntityMap(s) {
return entityMap[s] || s return entityMap[s] || s
}) })

View File

@ -2,11 +2,13 @@
import { DatePicker } from "@budibase/bbui" import { DatePicker } from "@budibase/bbui"
import { getContext } from "svelte" import { getContext } from "svelte"
const { styleable } = getContext("sdk") const { styleable, setBindableValue } = getContext("sdk")
const component = getContext("component") const component = getContext("component")
export let placeholder export let placeholder
export let value
let value
$: setBindableValue(value, $component.id)
function handleChange(event) { function handleChange(event) {
const [fullDate] = event.detail const [fullDate] = event.detail