mirror of
https://github.com/immich-app/immich.git
synced 2025-12-25 06:17:34 -05:00
* chore(web): another missing translations * unused removed * more keys * lint fix * test fixed * dynamic translation fix * fixes * people search translation * params fixed * keep filter setting fix * lint fix * $t fixes * Update web/src/lib/i18n/en.json Co-authored-by: Michel Heusschen <59014050+michelheusschen@users.noreply.github.com> * another missing * activity translation * link sharing translations * expiration dropdown fix - didn't work localized * notification title * device logout * search results * reset to default * unsaved change * select from computer * selected * select-2 * select-3 * unmerge * pluralize, force icu message * Update web/src/lib/components/asset-viewer/asset-viewer.svelte Co-authored-by: Michel Heusschen <59014050+michelheusschen@users.noreply.github.com> * review fixes * remove user * plural fixes * ffmpeg settings * fixes * error title * plural fixes * onboarding * change password * more more * console log fix * another * api key desc * map marker * format fix * key fix * asset-utils * utils * misc --------- Co-authored-by: Michel Heusschen <59014050+michelheusschen@users.noreply.github.com>
34 lines
947 B
Svelte
34 lines
947 B
Svelte
<script lang="ts">
|
|
import { dateFormats } from '$lib/constants';
|
|
import { locale } from '$lib/stores/preferences.store';
|
|
import type { AlbumResponseDto } from '@immich/sdk';
|
|
import { t } from 'svelte-i18n';
|
|
|
|
export let album: AlbumResponseDto;
|
|
|
|
$: startDate = formatDate(album.startDate);
|
|
$: endDate = formatDate(album.endDate);
|
|
|
|
const formatDate = (date?: string) => {
|
|
return date ? new Date(date).toLocaleDateString($locale, dateFormats.album) : undefined;
|
|
};
|
|
|
|
const getDateRange = (start?: string, end?: string) => {
|
|
if (start && end && start !== end) {
|
|
return `${start} - ${end}`;
|
|
}
|
|
|
|
if (start) {
|
|
return start;
|
|
}
|
|
|
|
return '';
|
|
};
|
|
</script>
|
|
|
|
<span class="my-2 flex gap-2 text-sm font-medium text-gray-500" data-testid="album-details">
|
|
<span>{getDateRange(startDate, endDate)}</span>
|
|
<span>•</span>
|
|
<span>{$t('items_count', { values: { count: album.assetCount } })}</span>
|
|
</span>
|