2022-12-16 14:26:12 -06:00
|
|
|
<script lang="ts">
|
2024-02-22 15:36:14 +01:00
|
|
|
import { locale } from '$lib/stores/preferences.store';
|
2024-02-14 08:09:49 -05:00
|
|
|
import type { SystemConfigTemplateStorageOptionDto } from '@immich/sdk';
|
2024-02-22 15:36:14 +01:00
|
|
|
import { DateTime } from 'luxon';
|
2024-06-04 21:53:00 +02:00
|
|
|
import { t } from 'svelte-i18n';
|
2022-12-16 14:26:12 -06:00
|
|
|
|
2024-11-14 08:43:25 -06:00
|
|
|
interface Props {
|
|
|
|
|
options: SystemConfigTemplateStorageOptionDto;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let { options }: Props = $props();
|
2022-12-16 14:26:12 -06:00
|
|
|
|
2023-07-01 00:50:47 -04:00
|
|
|
const getLuxonExample = (format: string) => {
|
2024-02-22 15:36:14 +01:00
|
|
|
return DateTime.fromISO('2022-09-04T20:03:05.250Z', { locale: $locale }).toFormat(format);
|
2023-07-01 00:50:47 -04:00
|
|
|
};
|
2022-12-16 14:26:12 -06:00
|
|
|
</script>
|
|
|
|
|
|
2023-10-20 14:17:17 -07:00
|
|
|
<div class="mt-2 text-sm">
|
2025-09-16 00:28:42 -03:00
|
|
|
<h4 class="uppercase">{$t('date_and_time')}</h4>
|
2022-12-16 14:26:12 -06:00
|
|
|
</div>
|
|
|
|
|
|
2025-03-03 14:24:26 +00:00
|
|
|
<!-- eslint-disable svelte/no-useless-mustaches -->
|
2023-07-18 13:19:39 -05:00
|
|
|
<div class="mt-2 rounded-lg bg-gray-200 p-4 text-xs dark:bg-gray-700 dark:text-immich-dark-fg">
|
2023-07-01 00:50:47 -04:00
|
|
|
<div class="mb-2 text-gray-600 dark:text-immich-dark-fg">
|
2024-07-01 00:29:10 +02:00
|
|
|
<p>{$t('admin.storage_template_date_time_description')}</p>
|
2025-05-30 20:18:22 +02:00
|
|
|
<p>{$t('admin.storage_template_date_time_sample', { values: { date: '2022-09-04T20:03:05.250' } })}</p>
|
2023-07-01 00:50:47 -04:00
|
|
|
</div>
|
2023-09-28 19:47:31 +02:00
|
|
|
<div class="flex gap-[40px]">
|
2023-07-01 00:50:47 -04:00
|
|
|
<div>
|
2025-09-17 12:12:51 -04:00
|
|
|
<p class="uppercase font-medium text-primary">{$t('year')}</p>
|
2023-07-01 00:50:47 -04:00
|
|
|
<ul>
|
2025-03-03 14:24:26 +00:00
|
|
|
{#each options.yearOptions as yearFormat, index (index)}
|
2023-07-01 00:50:47 -04:00
|
|
|
<li>{'{{'}{yearFormat}{'}}'} - {getLuxonExample(yearFormat)}</li>
|
|
|
|
|
{/each}
|
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
2022-12-16 14:26:12 -06:00
|
|
|
|
2023-07-01 00:50:47 -04:00
|
|
|
<div>
|
2025-09-17 12:12:51 -04:00
|
|
|
<p class="uppercase font-medium text-primary">{$t('month')}</p>
|
2023-07-01 00:50:47 -04:00
|
|
|
<ul>
|
2025-03-03 14:24:26 +00:00
|
|
|
{#each options.monthOptions as monthFormat, index (index)}
|
2023-07-01 00:50:47 -04:00
|
|
|
<li>{'{{'}{monthFormat}{'}}'} - {getLuxonExample(monthFormat)}</li>
|
|
|
|
|
{/each}
|
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
2022-12-16 14:26:12 -06:00
|
|
|
|
2023-09-28 19:47:31 +02:00
|
|
|
<div>
|
2025-09-17 12:12:51 -04:00
|
|
|
<p class="uppercase font-medium text-primary">{$t('week')}</p>
|
2023-09-28 19:47:31 +02:00
|
|
|
<ul>
|
2025-03-03 14:24:26 +00:00
|
|
|
{#each options.weekOptions as weekFormat, index (index)}
|
2023-09-28 19:47:31 +02:00
|
|
|
<li>{'{{'}{weekFormat}{'}}'} - {getLuxonExample(weekFormat)}</li>
|
|
|
|
|
{/each}
|
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
|
|
|
|
|
2023-07-01 00:50:47 -04:00
|
|
|
<div>
|
2025-09-17 12:12:51 -04:00
|
|
|
<p class="uppercase font-medium text-primary">{$t('day')}</p>
|
2023-07-01 00:50:47 -04:00
|
|
|
<ul>
|
2025-03-03 14:24:26 +00:00
|
|
|
{#each options.dayOptions as dayFormat, index (index)}
|
2023-07-01 00:50:47 -04:00
|
|
|
<li>{'{{'}{dayFormat}{'}}'} - {getLuxonExample(dayFormat)}</li>
|
|
|
|
|
{/each}
|
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
2022-12-16 14:26:12 -06:00
|
|
|
|
2023-07-01 00:50:47 -04:00
|
|
|
<div>
|
2025-09-17 12:12:51 -04:00
|
|
|
<p class="uppercase font-medium text-primary">{$t('hour')}</p>
|
2023-07-01 00:50:47 -04:00
|
|
|
<ul>
|
2025-03-03 14:24:26 +00:00
|
|
|
{#each options.hourOptions as dayFormat, index (index)}
|
2023-07-01 00:50:47 -04:00
|
|
|
<li>{'{{'}{dayFormat}{'}}'} - {getLuxonExample(dayFormat)}</li>
|
|
|
|
|
{/each}
|
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
2022-12-16 14:26:12 -06:00
|
|
|
|
2023-07-01 00:50:47 -04:00
|
|
|
<div>
|
2025-09-17 12:12:51 -04:00
|
|
|
<p class="uppercase font-medium text-primary">{$t('minute')}</p>
|
2023-07-01 00:50:47 -04:00
|
|
|
<ul>
|
2025-03-03 14:24:26 +00:00
|
|
|
{#each options.minuteOptions as dayFormat, index (index)}
|
2023-07-01 00:50:47 -04:00
|
|
|
<li>{'{{'}{dayFormat}{'}}'} - {getLuxonExample(dayFormat)}</li>
|
|
|
|
|
{/each}
|
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
2022-12-16 14:26:12 -06:00
|
|
|
|
2023-07-01 00:50:47 -04:00
|
|
|
<div>
|
2025-09-17 12:12:51 -04:00
|
|
|
<p class="uppercase font-medium text-primary">{$t('second')}</p>
|
2023-07-01 00:50:47 -04:00
|
|
|
<ul>
|
2025-03-03 14:24:26 +00:00
|
|
|
{#each options.secondOptions as dayFormat, index (index)}
|
2023-07-01 00:50:47 -04:00
|
|
|
<li>{'{{'}{dayFormat}{'}}'} - {getLuxonExample(dayFormat)}</li>
|
|
|
|
|
{/each}
|
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2022-12-16 14:26:12 -06:00
|
|
|
</div>
|