mirror of
https://github.com/immich-app/immich.git
synced 2026-05-18 03:10:24 +03:00
fix: album card timezone (#24855)
This commit is contained in:
@@ -27,6 +27,9 @@ export const getShortDateRange = (startDate: string | Date, endDate: string | Da
|
|||||||
const endDateLocalized = endDate.toLocaleString(userLocale, {
|
const endDateLocalized = endDate.toLocaleString(userLocale, {
|
||||||
month: 'short',
|
month: 'short',
|
||||||
year: 'numeric',
|
year: 'numeric',
|
||||||
|
// The API returns the date in UTC. If the earliest asset was taken on Jan 1st at 1am,
|
||||||
|
// we expect the album to start in January, even if the local timezone is UTC-5 for instance.
|
||||||
|
timeZone: 'UTC',
|
||||||
});
|
});
|
||||||
|
|
||||||
if (startDate.getFullYear() === endDate.getFullYear()) {
|
if (startDate.getFullYear() === endDate.getFullYear()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user