Show the task's due date in the calendar's schedule dialog

The dialog shows the due date as a read-only field; it is changed on the
task's edit page.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This commit is contained in:
2026-11-25 11:07:43 +02:00
co-authored by Claude Sonnet 5.5
parent 616b9fa5ad
commit ede7043765
5 changed files with 24 additions and 0 deletions
@@ -61,6 +61,10 @@ new class extends Component
#[Locked]
public string $dialogStatus = '';
/** The task's due date for display (j.n.Y), changed on the task's edit page. */
#[Locked]
public string $dialogDueOn = '';
public string $plannedFrom = '';
public string $plannedTo = '';
@@ -255,6 +259,7 @@ new class extends Component
$this->dialogUserId = $userId;
$this->dialogTitle = __('jobs.calendar.dialog_task', ['title' => $task->title, 'job' => $task->jobNumber]);
$this->dialogStatus = $task->status->value;
$this->dialogDueOn = $task->dueOn === null ? __('jobs.not_set') : $this->shortDate($task->dueOn);
$this->plannedFrom = $task->plannedFrom ?? CarbonImmutable::today()->format('Y-m-d');
$this->plannedTo = $task->plannedTo ?? '';
$this->assignee = $userId === null ? '' : (string) $userId;
@@ -818,6 +823,8 @@ new class extends Component
<p class="font-medium break-words">{{ $dialogTitle }}</p>
<form id="task-schedule-form" wire:submit="saveDialog" class="mt-4 space-y-4" novalidate>
<x-input id="task-schedule-due-on" :value="$dialogDueOn" readonly :label="__('jobs.calendar.fields.due_on')" :hint="__('jobs.calendar.fields.due_on_hint')" />
@if ($dialogJobId !== null && Gate::allows('jobs.manage-tasks', $dialogJobId))
<x-input wire:model="plannedFrom" type="date" :label="__('jobs.calendar.fields.from')" required />
<x-input wire:model="plannedTo" type="date" :label="__('jobs.calendar.fields.to')" :hint="__('jobs.calendar.fields.to_hint')" />