feat(web): use timeline in geolocation manager (#21492)

This commit is contained in:
Johann
2025-09-10 03:26:26 +02:00
committed by GitHub
parent 5acd6b70d0
commit 7a1c45c364
20 changed files with 277 additions and 496 deletions

View File

@@ -85,33 +85,3 @@ export const getAlbumDateRange = (album: { startDate?: string; endDate?: string
*/
export const asLocalTimeISO = (date: DateTime<true>) =>
(date.setZone('utc', { keepLocalTime: true }) as DateTime<true>).toISO();
/**
* Creates a date range for filtering assets based on year, month, and day parameters
*/
export const buildDateRangeFromYearMonthAndDay = (year: number, month?: number, day?: number) => {
const baseDate = DateTime.fromObject({
year,
month: month || 1,
day: day || 1,
});
let from: DateTime;
let to: DateTime;
if (day) {
from = baseDate.startOf('day');
to = baseDate.plus({ days: 1 }).startOf('day');
} else if (month) {
from = baseDate.startOf('month');
to = baseDate.plus({ months: 1 }).startOf('month');
} else {
from = baseDate.startOf('year');
to = baseDate.plus({ years: 1 }).startOf('year');
}
return {
from: from.toISO() || undefined,
to: to.toISO() || undefined,
};
};