From 609092582ea849a2ade1238424480361506464b1 Mon Sep 17 00:00:00 2001 From: Snowknight26 Date: Mon, 23 Feb 2026 09:40:40 -0600 Subject: [PATCH 1/3] chore(web): deduplicate storage template examples --- .../SupportedDatetimePanel.svelte | 88 +++++-------------- 1 file changed, 21 insertions(+), 67 deletions(-) diff --git a/web/src/lib/components/admin-settings/SupportedDatetimePanel.svelte b/web/src/lib/components/admin-settings/SupportedDatetimePanel.svelte index de455380a9278..c30bb27d9ce60 100644 --- a/web/src/lib/components/admin-settings/SupportedDatetimePanel.svelte +++ b/web/src/lib/components/admin-settings/SupportedDatetimePanel.svelte @@ -11,85 +11,39 @@ let { options }: Props = $props(); - const getLuxonExample = (format: string) => { - return DateTime.fromISO('2022-02-15T20:03:05.250Z', { locale: $locale }).toFormat(format); - }; + const getExampleDate = () => DateTime.fromISO('2022-02-15T20:03:05.250Z', { locale: $locale }); + +{#snippet example(title: string, options: Array)} +
+ {title} + +
+{/snippet} + {$t('date_and_time')} - {$t('admin.storage_template_date_time_description')} {$t('admin.storage_template_date_time_sample', { values: { date: '2022-02-15T20:03:05.250+00:00' } })}{$t('admin.storage_template_date_time_sample', { values: { date: getExampleDate().toISO() }})}
-
- {$t('year')} -
    - {#each options.yearOptions as yearFormat, index (index)} -
  • {'{{'}{yearFormat}{'}}'} - {getLuxonExample(yearFormat)}
  • - {/each} -
-
- -
- {$t('month')} -
    - {#each options.monthOptions as monthFormat, index (index)} -
  • {'{{'}{monthFormat}{'}}'} - {getLuxonExample(monthFormat)}
  • - {/each} -
-
- -
- {$t('week')} -
    - {#each options.weekOptions as weekFormat, index (index)} -
  • {'{{'}{weekFormat}{'}}'} - {getLuxonExample(weekFormat)}
  • - {/each} -
-
- -
- {$t('day')} -
    - {#each options.dayOptions as dayFormat, index (index)} -
  • {'{{'}{dayFormat}{'}}'} - {getLuxonExample(dayFormat)}
  • - {/each} -
-
- -
- {$t('hour')} -
    - {#each options.hourOptions as dayFormat, index (index)} -
  • {'{{'}{dayFormat}{'}}'} - {getLuxonExample(dayFormat)}
  • - {/each} -
-
- -
- {$t('minute')} -
    - {#each options.minuteOptions as dayFormat, index (index)} -
  • {'{{'}{dayFormat}{'}}'} - {getLuxonExample(dayFormat)}
  • - {/each} -
-
- -
- {$t('second')} -
    - {#each options.secondOptions as dayFormat, index (index)} -
  • {'{{'}{dayFormat}{'}}'} - {getLuxonExample(dayFormat)}
  • - {/each} -
-
+ {@render example($t('year'), options.yearOptions)} + {@render example($t('month'), options.monthOptions)} + {@render example($t('week'), options.weekOptions)} + {@render example($t('day'), options.dayOptions)} + {@render example($t('hour'), options.hourOptions)} + {@render example($t('minute'), options.minuteOptions)} + {@render example($t('second'), options.secondOptions)}
From da5c73a3db4f91519d2ed7abb9ccf5484eccdb40 Mon Sep 17 00:00:00 2001 From: Snowknight26 Date: Mon, 23 Feb 2026 10:16:36 -0600 Subject: [PATCH 2/3] Fix type check --- .../lib/components/admin-settings/SupportedDatetimePanel.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/src/lib/components/admin-settings/SupportedDatetimePanel.svelte b/web/src/lib/components/admin-settings/SupportedDatetimePanel.svelte index c30bb27d9ce60..93da47ca63da0 100644 --- a/web/src/lib/components/admin-settings/SupportedDatetimePanel.svelte +++ b/web/src/lib/components/admin-settings/SupportedDatetimePanel.svelte @@ -15,7 +15,7 @@ -{#snippet example(title: string, options: Array)} +{#snippet example(title: string, options: Array)}
{title}
    From 79fa05351a094407c72fa1d41c0b755b182bbd5f Mon Sep 17 00:00:00 2001 From: Snowknight26 Date: Mon, 23 Feb 2026 13:47:56 -0600 Subject: [PATCH 3/3] Fix formatting --- .../components/admin-settings/SupportedDatetimePanel.svelte | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/web/src/lib/components/admin-settings/SupportedDatetimePanel.svelte b/web/src/lib/components/admin-settings/SupportedDatetimePanel.svelte index 93da47ca63da0..c22d3cb792ff9 100644 --- a/web/src/lib/components/admin-settings/SupportedDatetimePanel.svelte +++ b/web/src/lib/components/admin-settings/SupportedDatetimePanel.svelte @@ -12,7 +12,6 @@ let { options }: Props = $props(); const getExampleDate = () => DateTime.fromISO('2022-02-15T20:03:05.250Z', { locale: $locale }); - {#snippet example(title: string, options: Array)} @@ -32,7 +31,7 @@ {$t('admin.storage_template_date_time_description')} {$t('admin.storage_template_date_time_sample', { values: { date: getExampleDate().toISO() }})}{$t('admin.storage_template_date_time_sample', { values: { date: getExampleDate().toISO() } })}