diff --git a/packages/ui/src/components/calendar/DueDatePresenter.svelte b/packages/ui/src/components/calendar/DueDatePresenter.svelte index 4190131e72..fa1dba5047 100644 --- a/packages/ui/src/components/calendar/DueDatePresenter.svelte +++ b/packages/ui/src/components/calendar/DueDatePresenter.svelte @@ -16,6 +16,7 @@ import { Timestamp } from '@hcengineering/core' import DueDatePopup from './DueDatePopup.svelte' import { tooltip } from '../../tooltips' + import ui from '../../plugin' import DatePresenter from './DatePresenter.svelte' import { getDaysDifference, getDueDateIconModifier, getFormattedDate } from './internal/DateUtils' import { ButtonKind, ButtonSize } from '../../types' @@ -67,6 +68,7 @@ : undefined} > diff --git a/plugins/task-resources/src/components/DueDateEditor.svelte b/plugins/task-resources/src/components/DueDateEditor.svelte index fd8f3e4e75..e67d6ccd89 100644 --- a/plugins/task-resources/src/components/DueDateEditor.svelte +++ b/plugins/task-resources/src/components/DueDateEditor.svelte @@ -10,6 +10,7 @@ export let size: ButtonSize = 'medium' export let kind: ButtonKind = 'link' export let editable: boolean = true + export let onChange: ((value: any) => void) | undefined const client = getClient() $: status = $statusStore.byId.get(object.status) @@ -21,15 +22,19 @@ return } - await client.updateCollection( - object._class, - object.space, - object._id, - object.attachedTo, - object.attachedToClass, - object.collection, - { dueDate: newDueDate } - ) + if (onChange !== undefined) { + onChange(newDueDate) + } else { + await client.updateCollection( + object._class, + object.space, + object._id, + object.attachedTo, + object.attachedToClass, + object.collection, + { dueDate: newDueDate } + ) + } }