diff --git a/models/tracker/src/index.ts b/models/tracker/src/index.ts index 8f233e4419..39eea58ae4 100644 --- a/models/tracker/src/index.ts +++ b/models/tracker/src/index.ts @@ -1131,7 +1131,7 @@ export function createModel (builder: Builder): void { props: { mondayStart: true, withTime: false }, element: 'top', fillProps: { - _object: 'value' + _objects: 'value' } }, label: tracker.string.SetDueDate, diff --git a/plugins/tracker-resources/src/components/SetDueDateActionPopup.svelte b/plugins/tracker-resources/src/components/SetDueDateActionPopup.svelte index 55c9cbed54..180fcb01e3 100644 --- a/plugins/tracker-resources/src/components/SetDueDateActionPopup.svelte +++ b/plugins/tracker-resources/src/components/SetDueDateActionPopup.svelte @@ -19,7 +19,7 @@ import { Issue } from '@hcengineering/tracker' import { createEventDispatcher } from 'svelte' - export let value: Issue | AttachedData + export let value: Issue | AttachedData | Issue[] export let mondayStart = true export let withTime = false @@ -29,14 +29,17 @@ async function onUpdate ({ detail }: CustomEvent) { const newDueDate = detail && detail?.getTime() - if ('_id' in value && newDueDate !== undefined && newDueDate !== value.dueDate) { - await client.update(value, { dueDate: newDueDate }) + const vv = Array.isArray(value) ? value : [value] + for (const docValue of vv) { + if ('_id' in docValue && newDueDate !== undefined && newDueDate !== docValue.dueDate) { + await client.update(docValue, { dueDate: newDueDate }) + } } dispatch('update', newDueDate) } - $: currentDate = value.dueDate !== null ? new Date(value.dueDate) : null + $: currentDate = Array.isArray(value) || value.dueDate === null ? null : new Date(value.dueDate)