diff --git a/web/src/lib/components/admin-page/server-stats/server-stats-panel.svelte b/web/src/lib/components/admin-page/server-stats/server-stats-panel.svelte index 0c53a542ad..b0b236b865 100644 --- a/web/src/lib/components/admin-page/server-stats/server-stats-panel.svelte +++ b/web/src/lib/components/admin-page/server-stats/server-stats-panel.svelte @@ -18,7 +18,7 @@ $: [spaceUsage, spaceUnit] = getBytesWithUnit(stats.usageRaw); - const locale = navigator.languages; + const locale = navigator.language;
@@ -28,7 +28,7 @@
- +
diff --git a/web/src/lib/components/admin-page/user-management.svelte b/web/src/lib/components/admin-page/user-management.svelte index 59db1aeaf5..f52f826a65 100644 --- a/web/src/lib/components/admin-page/user-management.svelte +++ b/web/src/lib/components/admin-page/user-management.svelte @@ -14,9 +14,11 @@ return user.deletedAt != null; }; - const locale = navigator.languages; + const locale = navigator.language; const deleteDateFormat: Intl.DateTimeFormatOptions = { - month: 'long', day: 'numeric', year: 'numeric' + month: 'long', + day: 'numeric', + year: 'numeric' }; const getDeleteDate = (user: UserResponseDto): string => { diff --git a/web/src/lib/components/album-page/album-card.svelte b/web/src/lib/components/album-page/album-card.svelte index bb4770c4b3..de86ec50b8 100644 --- a/web/src/lib/components/album-page/album-card.svelte +++ b/web/src/lib/components/album-page/album-card.svelte @@ -54,7 +54,7 @@ imageData = (await loadHighQualityThumbnail(album.albumThumbnailAssetId)) || NO_THUMBNAIL; }); - const locale = navigator.languages; + const locale = navigator.language;
{ const startDate = new Date(album.assets[0].createdAt); @@ -101,7 +101,9 @@ const endDateString = endDate.toLocaleDateString(locale, albumDateFormat); // If the start and end date are the same, only show one date - return startDateString === endDateString ? startDateString : `${startDateString} - ${endDateString}`; + return startDateString === endDateString + ? startDateString + : `${startDateString} - ${endDateString}`; }; onMount(async () => { diff --git a/web/src/lib/components/asset-viewer/detail-panel.svelte b/web/src/lib/components/asset-viewer/detail-panel.svelte index 65568f2b26..627e8569a6 100644 --- a/web/src/lib/components/asset-viewer/detail-panel.svelte +++ b/web/src/lib/components/asset-viewer/detail-panel.svelte @@ -70,7 +70,7 @@ return undefined; }; - const locale = navigator.languages; + const locale = navigator.language;
@@ -100,10 +100,21 @@
-

{assetDateTimeOriginal.toLocaleDateString(locale, {month:'short', day:'numeric', year: 'numeric'})}

+

+ {assetDateTimeOriginal.toLocaleDateString(locale, { + month: 'short', + day: 'numeric', + year: 'numeric' + })} +

- {assetDateTimeOriginal.toLocaleString(locale, {weekday:'short', hour: 'numeric', minute: '2-digit', timeZoneName:'longOffset'})} + {assetDateTimeOriginal.toLocaleString(locale, { + weekday: 'short', + hour: 'numeric', + minute: '2-digit', + timeZoneName: 'longOffset' + })}

diff --git a/web/src/lib/components/photos-page/asset-date-group.svelte b/web/src/lib/components/photos-page/asset-date-group.svelte index 6da41f3183..32e56bdc0c 100644 --- a/web/src/lib/components/photos-page/asset-date-group.svelte +++ b/web/src/lib/components/photos-page/asset-date-group.svelte @@ -18,7 +18,7 @@ export let bucketHeight: number; export let isAlbumSelectionMode = false; - const locale = navigator.languages; + const locale = navigator.language; const groupDateFormat: Intl.DateTimeFormatOptions = { weekday: 'short', month: 'short', @@ -114,7 +114,10 @@ bind:clientHeight={actualBucketHeight} > {#each assetsGroupByDate as assetsInDateGroup, groupIndex (assetsInDateGroup[0].id)} - {@const dateGroupTitle = new Date(assetsInDateGroup[0].createdAt).toLocaleDateString(locale, groupDateFormat)} + {@const dateGroupTitle = new Date(assetsInDateGroup[0].createdAt).toLocaleDateString( + locale, + groupDateFormat + )}