mirror of
https://github.com/immich-app/immich.git
synced 2025-11-15 23:52:38 +09:00
feat(web): Localize dates and numbers (#1056)
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
import PlayCircle from 'svelte-material-icons/PlayCircle.svelte';
|
||||
import Memory from 'svelte-material-icons/Memory.svelte';
|
||||
import StatsCard from './stats-card.svelte';
|
||||
import { getBytesWithUnit, asByteUnitString } from '../../../utils/byte-units';
|
||||
export let stats: ServerStatsResponseDto;
|
||||
export let allUsers: Array<UserResponseDto>;
|
||||
|
||||
@@ -15,8 +16,9 @@
|
||||
return name;
|
||||
};
|
||||
|
||||
$: spaceUnit = stats.usage.split(' ')[1];
|
||||
$: spaceUsage = stats.usage.split(' ')[0];
|
||||
$: [spaceUsage, spaceUnit] = getBytesWithUnit(stats.usageRaw);
|
||||
|
||||
const locale = navigator.languages;
|
||||
</script>
|
||||
|
||||
<div class="flex flex-col gap-5">
|
||||
@@ -55,9 +57,9 @@
|
||||
}`}
|
||||
>
|
||||
<td class="text-sm px-2 w-1/4 text-ellipsis">{getFullName(user.userId)}</td>
|
||||
<td class="text-sm px-2 w-1/4 text-ellipsis">{user.photos}</td>
|
||||
<td class="text-sm px-2 w-1/4 text-ellipsis">{user.videos}</td>
|
||||
<td class="text-sm px-2 w-1/4 text-ellipsis">{user.usage}</td>
|
||||
<td class="text-sm px-2 w-1/4 text-ellipsis">{user.photos.toLocaleString(locale)}</td>
|
||||
<td class="text-sm px-2 w-1/4 text-ellipsis">{user.videos.toLocaleString(locale)}</td>
|
||||
<td class="text-sm px-2 w-1/4 text-ellipsis">{asByteUnitString(user.usageRaw)}</td>
|
||||
</tr>
|
||||
{/each}
|
||||
</tbody>
|
||||
|
||||
Reference in New Issue
Block a user