Calcule date de fin en fonction du temps estimé

This commit is contained in:
2026-05-30 06:46:02 +02:00
parent b3bc0f9336
commit e81d465903
3 changed files with 79 additions and 4 deletions
@@ -122,6 +122,24 @@ export class IssueDetail {
protected set estimatedTimeValue(value: number | null) {
this.issue.estimatedTime = value === null || value === undefined ? null : Number(value);
this.recalculateEndDate();
}
private recalculateEndDate(): void {
const { startDate, estimatedTime } = this.issue;
if (!startDate || estimatedTime === null || estimatedTime <= 0) {
this.issue.endDate = '';
return;
}
const start = new Date(startDate);
const extraDays = Math.max(0, Math.ceil(estimatedTime / 8) - 1);
start.setDate(start.getDate() + extraDays);
this.issue.endDate = start.toISOString().split('T')[0];
}
protected onStartDateBlur(): void {
this.recalculateEndDate();
this.saveIssue();
}
protected get issueTypeValue(): IssueEntity['type'] {