mirror of
https://github.com/immich-app/immich.git
synced 2024-12-28 14:41: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 { chain } from 'lodash-es';
|
||||
import { groupBy, sortBy } from 'lodash-es';
|
||||
import { DateTime, Interval } from 'luxon';
|
||||
|
||||
export const fromLocalDateTime = (localDateTime: string) => DateTime.fromISO(localDateTime, { zone: 'UTC' });
|
||||
|
@ -45,8 +45,8 @@ export function splitBucketIntoDateGroups(
|
|||
assets: AssetResponseDto[],
|
||||
locale: string | undefined,
|
||||
): AssetResponseDto[][] {
|
||||
return chain(assets)
|
||||
.groupBy((asset) => fromLocalDateTime(asset.localDateTime).toLocaleString(groupDateFormat, { locale }))
|
||||
.sortBy((group) => assets.indexOf(group[0]))
|
||||
.value();
|
||||
const grouped = groupBy(assets, (asset) =>
|
||||
fromLocalDateTime(asset.localDateTime).toLocaleString(groupDateFormat, { locale }),
|
||||
);
|
||||
return sortBy(grouped, (group) => assets.indexOf(group[0]));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue