mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
Revert "perf(web): optimize date groups" (#7638)
Revert "perf(web): optimize date groups (#7593)"
This reverts commit 762c4684f8.
This commit is contained in:
parent
967019d9e0
commit
facd0bc3a4
6 changed files with 103 additions and 95 deletions
|
|
@ -1,4 +1,6 @@
|
|||
import { locale } from '$lib/stores/preferences.store';
|
||||
import type { AssetResponseDto } from '@immich/sdk';
|
||||
import { groupBy, sortBy } from 'lodash-es';
|
||||
import { DateTime, Interval } from 'luxon';
|
||||
import { get } from 'svelte/store';
|
||||
|
||||
|
|
@ -42,11 +44,20 @@ export function formatGroupTitle(date: DateTime): string {
|
|||
return date.toLocaleString(groupDateFormat);
|
||||
}
|
||||
|
||||
export function splitBucketIntoDateGroups(
|
||||
assets: AssetResponseDto[],
|
||||
locale: string | undefined,
|
||||
): AssetResponseDto[][] {
|
||||
const grouped = groupBy(assets, (asset) =>
|
||||
fromLocalDateTime(asset.localDateTime).toLocaleString(groupDateFormat, { locale }),
|
||||
);
|
||||
return sortBy(grouped, (group) => assets.indexOf(group[0]));
|
||||
}
|
||||
|
||||
export type LayoutBox = {
|
||||
top: number;
|
||||
left: number;
|
||||
width: number;
|
||||
height: number;
|
||||
};
|
||||
|
||||
export function calculateWidth(boxes: LayoutBox[]): number {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue