diff --git a/web/src/lib/components/photos-page/asset-grid.svelte b/web/src/lib/components/photos-page/asset-grid.svelte index c40aa7fe74..e8025a6542 100644 --- a/web/src/lib/components/photos-page/asset-grid.svelte +++ b/web/src/lib/components/photos-page/asset-grid.svelte @@ -1,44 +1,12 @@ - - -{#if isShowDeleteConfirmation} - (isShowDeleteConfirmation = false)} - onConfirm={() => handlePromiseError(trashOrDelete(true))} - /> -{/if} - -{#if isShowSelectDate} - { - isShowSelectDate = false; - const asset = await timelineManager.getClosestAssetToDate( - (DateTime.fromISO(dateString) as DateTime).toObject(), - ); - if (asset) { - setFocusAsset(asset); - } - }} - onCancel={() => (isShowSelectDate = false)} - /> -{/if} - -{#if timelineManager.months.length > 0} - { - evt.preventDefault(); - let amount = 50; - if (shiftKeyIsDown) { - amount = 500; - } - if (evt.key === 'ArrowUp') { - amount = -amount; - if (shiftKeyIsDown) { - element?.scrollBy({ top: amount, behavior: 'smooth' }); - } - } else if (evt.key === 'ArrowDown') { - element?.scrollBy({ top: amount, behavior: 'smooth' }); - } - }} - /> -{/if} - - -
((timelineManager.viewportWidth = v), updateSlidingWindow())} - bind:this={element} - onscroll={() => (handleTimelineScroll(), updateSlidingWindow(), updateIsScrolling())} -> -
-
- {@render children?.()} - {#if isEmpty} - - {@render empty?.()} - {/if} -
- - {#each timelineManager.months as monthGroup (monthGroup.viewId)} - {@const display = monthGroup.intersecting} - {@const absoluteHeight = monthGroup.top} - - {#if !monthGroup.isLoaded} -
- -
- {:else if display} -
- handleGroupSelect(timelineManager, title, assets)} - onSelectAssetCandidates={handleSelectAssetCandidates} - onSelectAssets={handleSelectAssets} - onScrollCompensation={handleScrollCompensation} - {customLayout} - {onThumbnailClick} - /> -
- {/if} - {/each} - -
-
-
- - - {#if $showAssetViewer} - {#await import('../asset-viewer/asset-viewer.svelte') then { default: AssetViewer }} - - {/await} - {/if} - - - + + + diff --git a/web/src/lib/components/shared-components/change-date.spec.ts b/web/src/lib/components/shared-components/change-date.spec.ts index 43035051f3..3c835c05ed 100644 --- a/web/src/lib/components/shared-components/change-date.spec.ts +++ b/web/src/lib/components/shared-components/change-date.spec.ts @@ -8,6 +8,9 @@ import ChangeDate from './change-date.svelte'; describe('ChangeDate component', () => { const initialDate = DateTime.fromISO('2024-01-01'); const initialTimeZone = 'Europe/Berlin'; + const targetDate = DateTime.fromISO('2024-01-01').setZone('UTC+1', { + keepLocalTime: true, + }); const currentInterval = { start: DateTime.fromISO('2000-02-01T14:00:00+01:00'), end: DateTime.fromISO('2001-02-01T14:00:00+01:00'), @@ -43,7 +46,11 @@ describe('ChangeDate component', () => { await fireEvent.click(getConfirmButton()); - expect(onConfirm).toHaveBeenCalledWith({ mode: 'absolute', date: '2024-01-01T00:00:00.000+01:00' }); + expect(onConfirm).toHaveBeenCalledWith({ + mode: 'absolute', + date: '2024-01-01T00:00:00.000+01:00', + dateTime: targetDate, + }); }); test('calls onCancel on cancel', async () => { @@ -58,7 +65,9 @@ describe('ChangeDate component', () => { describe('when date is in daylight saving time', () => { const dstDate = DateTime.fromISO('2024-07-01'); - + const targetDate = DateTime.fromISO('2024-07-01').setZone('UTC+2', { + keepLocalTime: true, + }); test('should render correct timezone with offset', () => { render(ChangeDate, { initialDate: dstDate, initialTimeZone, onCancel, onConfirm }); @@ -72,7 +81,11 @@ describe('ChangeDate component', () => { await fireEvent.click(getConfirmButton()); - expect(onConfirm).toHaveBeenCalledWith({ mode: 'absolute', date: '2024-07-01T00:00:00.000+02:00' }); + expect(onConfirm).toHaveBeenCalledWith({ + mode: 'absolute', + date: '2024-07-01T00:00:00.000+02:00', + dateTime: targetDate, + }); }); }); diff --git a/web/src/lib/components/shared-components/change-date.svelte b/web/src/lib/components/shared-components/change-date.svelte index 00a6b05dc5..dd027b38cc 100644 --- a/web/src/lib/components/shared-components/change-date.svelte +++ b/web/src/lib/components/shared-components/change-date.svelte @@ -1,15 +1,14 @@