mirror of
https://github.com/immich-app/immich.git
synced 2025-12-16 01:10:57 +03:00
fix(web): handle buckets before year 1000 (#21832)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { locale } from '$lib/stores/preferences.store';
|
||||
import { parseUtcDate } from '$lib/utils/date-time';
|
||||
import { formatGroupTitle } from '$lib/utils/timeline-util';
|
||||
import { formatGroupTitle, toISOYearMonthUTC } from '$lib/utils/timeline-util';
|
||||
import { DateTime } from 'luxon';
|
||||
|
||||
describe('formatGroupTitle', () => {
|
||||
@@ -77,3 +77,13 @@ describe('formatGroupTitle', () => {
|
||||
expect(formatGroupTitle(date)).toBe('Invalid DateTime');
|
||||
});
|
||||
});
|
||||
|
||||
describe('toISOYearMonthUTC', () => {
|
||||
it('should prefix year with 0s', () => {
|
||||
expect(toISOYearMonthUTC({ year: 28, month: 1 })).toBe('0028-01-01T00:00:00.000Z');
|
||||
});
|
||||
|
||||
it('should prefix month with 0s', () => {
|
||||
expect(toISOYearMonthUTC({ year: 2025, month: 1 })).toBe('2025-01-01T00:00:00.000Z');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user