mirror of
https://github.com/immich-app/immich
synced 2025-10-17 18:19:27 +00:00
fix: navigate to time action (#20928)
* fix: navigate to time action * change-date -> DateSelectionModal; use luxon; use handle* for callback fn name * refactor change-date dialogs * Review comments * chore: clean up --------- Co-authored-by: Jason Rasmussen <jason@rasm.me>
This commit is contained in:
parent
d0eae97037
commit
2919ee4c65
19 changed files with 647 additions and 477 deletions
|
|
@ -16,6 +16,7 @@ import {
|
|||
runAssetOperation,
|
||||
} from '$lib/managers/timeline-manager/internal/operations-support.svelte';
|
||||
import {
|
||||
findClosestGroupForDate,
|
||||
findMonthGroupForAsset as findMonthGroupForAssetUtil,
|
||||
findMonthGroupForDate,
|
||||
getAssetWithOffset,
|
||||
|
|
@ -584,9 +585,13 @@ export class TimelineManager {
|
|||
}
|
||||
|
||||
async getClosestAssetToDate(dateTime: TimelineDateTime) {
|
||||
const monthGroup = findMonthGroupForDate(this, dateTime);
|
||||
let monthGroup = findMonthGroupForDate(this, dateTime);
|
||||
if (!monthGroup) {
|
||||
return;
|
||||
// if exact match not found, find closest
|
||||
monthGroup = findClosestGroupForDate(this.months, dateTime);
|
||||
if (!monthGroup) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
await this.loadMonthGroup(dateTime, { cancelable: false });
|
||||
const asset = monthGroup.findClosest(dateTime);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue