diff --git a/frontend/src/lib/components/DisplayResult.svelte b/frontend/src/lib/components/DisplayResult.svelte index 9f912d9232..10f14635ad 100644 --- a/frontend/src/lib/components/DisplayResult.svelte +++ b/frontend/src/lib/components/DisplayResult.svelte @@ -143,11 +143,13 @@ {/if} {/if}{#if !forceJson && resultKind == 'table-col'}
{#each Object.keys(result) as col}
-
+
{col}
{#if Array.isArray(result[col])} diff --git a/frontend/src/lib/components/apps/components/inputs/AppDateInput.svelte b/frontend/src/lib/components/apps/components/inputs/AppDateInput.svelte index 99bd773708..3aa9dcc3e7 100644 --- a/frontend/src/lib/components/apps/components/inputs/AppDateInput.svelte +++ b/frontend/src/lib/components/apps/components/inputs/AppDateInput.svelte @@ -7,6 +7,7 @@ import AlignWrapper from '../helpers/AlignWrapper.svelte' import InputValue from '../helpers/InputValue.svelte' import InitializeComponent from '../helpers/InitializeComponent.svelte' + import { parseISO, format as formatDateFns } from 'date-fns' export let id: string export let configuration: RichConfigurations @@ -37,25 +38,17 @@ $: handleDefault(defaultValue) - function formatDate(dateString: string, format: string = 'DD.MM.YYYY') { - const date = new Date(dateString) - - if (format === '') { - format = 'DD.MM.YYYY' + function formatDate(dateString: string, formatString: string = 'dd.MM.yyyy') { + if (formatString === '') { + formatString = 'dd.MM.yyyy' } - const padZero = (num: number) => (num < 10 ? '0' + num : num.toString()) - - const formatTokens = { - YYYY: date.getFullYear(), - MM: padZero(date.getMonth() + 1), - DD: padZero(date.getDate()), - hh: padZero(date.getHours()), - mm: padZero(date.getMinutes()), - ss: padZero(date.getSeconds()) + try { + const isoDate = parseISO(dateString) + return formatDateFns(isoDate, formatString) + } catch (error) { + return 'Error formatting date:' + error.message } - - return format.replace(/YYYY|MM|DD|hh|mm|ss/g, (match) => formatTokens[match]) } $: value && outputs?.result.set(formatDate(value, format)) diff --git a/frontend/src/lib/components/apps/components/inputs/AppRangeInput.svelte b/frontend/src/lib/components/apps/components/inputs/AppRangeInput.svelte index c4b9af363b..46c2e49c80 100644 --- a/frontend/src/lib/components/apps/components/inputs/AppRangeInput.svelte +++ b/frontend/src/lib/components/apps/components/inputs/AppRangeInput.svelte @@ -29,6 +29,7 @@ let max = 42 let step = 1 let slider: HTMLElement + let disabled = false let values: [number, number] = [0, 0] @@ -66,6 +67,7 @@ + @@ -88,6 +90,7 @@ min={!min ? 0 : +min} max={!max ? 1 : +max} range + {disabled} />
diff --git a/frontend/src/lib/components/apps/editor/component/components.ts b/frontend/src/lib/components/apps/editor/component/components.ts index 6a7111c49f..38ebcfdcf7 100644 --- a/frontend/src/lib/components/apps/editor/component/components.ts +++ b/frontend/src/lib/components/apps/editor/component/components.ts @@ -1832,6 +1832,14 @@ This is a paragraph. value: 1, fieldType: 'number', tooltip: 'Spread between each number suggestion' + }, + disabled: { + type: 'static', + value: false, + fieldType: 'boolean', + onlyStatic: true, + tooltip: + 'Determine if the slider is disabled, or enabled (only disables interactions, and events)' } } }