2023-11-30 04:52:28 +01:00
|
|
|
<script lang="ts">
|
2025-10-16 13:44:09 -04:00
|
|
|
import MenuOption from '$lib/components/shared-components/context-menu/menu-option.svelte';
|
2025-09-16 13:37:01 -04:00
|
|
|
import { getAssetControlContext } from '$lib/components/timeline/AssetSelectControlBar.svelte';
|
2025-10-16 13:44:09 -04:00
|
|
|
import AssetSelectionChangeDateModal from '$lib/modals/AssetSelectionChangeDateModal.svelte';
|
|
|
|
|
import { modalManager } from '@immich/ui';
|
2025-05-17 22:57:08 -04:00
|
|
|
import { mdiCalendarEditOutline } from '@mdi/js';
|
2025-10-16 13:44:09 -04:00
|
|
|
import { DateTime } from 'luxon';
|
2025-05-17 22:57:08 -04:00
|
|
|
import { t } from 'svelte-i18n';
|
2024-11-14 08:43:25 -06:00
|
|
|
interface Props {
|
|
|
|
|
menuItem?: boolean;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let { menuItem = false }: Props = $props();
|
2023-11-30 04:52:28 +01:00
|
|
|
const { clearSelect, getOwnedAssets } = getAssetControlContext();
|
|
|
|
|
|
2025-10-16 13:44:09 -04:00
|
|
|
const handleChangeDate = async () => {
|
|
|
|
|
const success = await modalManager.show(AssetSelectionChangeDateModal, {
|
|
|
|
|
initialDate: DateTime.now(),
|
|
|
|
|
assets: getOwnedAssets(),
|
|
|
|
|
});
|
|
|
|
|
if (success) {
|
|
|
|
|
clearSelect();
|
2023-11-30 04:52:28 +01:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
{#if menuItem}
|
2025-10-16 13:44:09 -04:00
|
|
|
<MenuOption text={$t('change_date')} icon={mdiCalendarEditOutline} onClick={handleChangeDate} />
|
2023-11-30 04:52:28 +01:00
|
|
|
{/if}
|