mirror of
https://github.com/immich-app/immich.git
synced 2025-12-20 01:11:46 +03:00
feat: persistent memories (#15953)
feat: memories refactor chore: use heart as favorite icon fix: linting
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
export type Align = 'middle' | 'top-left' | 'top-right';
|
||||
export type Align = 'middle' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
|
||||
|
||||
export type ContextMenuPosition = { x: number; y: number };
|
||||
|
||||
@@ -28,5 +28,11 @@ export const getContextMenuPositionFromBoundingRect = (rect: DOMRect, align: Ali
|
||||
case 'top-right': {
|
||||
return { x: rect.x + rect.width, y: rect.y };
|
||||
}
|
||||
case 'bottom-left': {
|
||||
return { x: rect.x, y: rect.y + rect.height };
|
||||
}
|
||||
case 'bottom-right': {
|
||||
return { x: rect.x + rect.width, y: rect.y + rect.height };
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -77,3 +77,11 @@ export const getAlbumDateRange = (album: { startDate?: string; endDate?: string
|
||||
|
||||
return '';
|
||||
};
|
||||
|
||||
/**
|
||||
* Use this to convert from "5pm EST" to "5pm UTC"
|
||||
*
|
||||
* Useful with some APIs where you want to query by "today", but the values in the database are stored as UTC
|
||||
*/
|
||||
export const asLocalTimeISO = (date: DateTime<true>) =>
|
||||
(date.setZone('utc', { keepLocalTime: true }) as DateTime<true>).toISO();
|
||||
|
||||
Reference in New Issue
Block a user