mirror of
https://github.com/immich-app/immich.git
synced 2025-01-01 08:31:59 +00:00
fix: update lodash calls (#6996)
This commit is contained in:
parent
b67fddf4b8
commit
9d072b5f55
1 changed files with 5 additions and 5 deletions
|
@ -1,5 +1,5 @@
|
||||||
import type { AssetResponseDto } from '@api';
|
import type { AssetResponseDto } from '@api';
|
||||||
import { chain } from 'lodash-es';
|
import { groupBy, sortBy } from 'lodash-es';
|
||||||
import { DateTime, Interval } from 'luxon';
|
import { DateTime, Interval } from 'luxon';
|
||||||
|
|
||||||
export const fromLocalDateTime = (localDateTime: string) => DateTime.fromISO(localDateTime, { zone: 'UTC' });
|
export const fromLocalDateTime = (localDateTime: string) => DateTime.fromISO(localDateTime, { zone: 'UTC' });
|
||||||
|
@ -45,8 +45,8 @@ export function splitBucketIntoDateGroups(
|
||||||
assets: AssetResponseDto[],
|
assets: AssetResponseDto[],
|
||||||
locale: string | undefined,
|
locale: string | undefined,
|
||||||
): AssetResponseDto[][] {
|
): AssetResponseDto[][] {
|
||||||
return chain(assets)
|
const grouped = groupBy(assets, (asset) =>
|
||||||
.groupBy((asset) => fromLocalDateTime(asset.localDateTime).toLocaleString(groupDateFormat, { locale }))
|
fromLocalDateTime(asset.localDateTime).toLocaleString(groupDateFormat, { locale }),
|
||||||
.sortBy((group) => assets.indexOf(group[0]))
|
);
|
||||||
.value();
|
return sortBy(grouped, (group) => assets.indexOf(group[0]));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue