Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Send start and duration when nwd toggle changes

Oliver Günther2d2fa4b87fc9
diff --git a/frontend/src/app/shared/components/datepicker/multi-date-modal/multi-date.modal.ts b/frontend/src/app/shared/components/datepicker/multi-date-modal/multi-date.modal.ts
index dc8e8cea186..40b980fa321 100644
--- a/frontend/src/app/shared/components/datepicker/multi-date-modal/multi-date.modal.ts
+++ b/frontend/src/app/shared/components/datepicker/multi-date-modal/multi-date.modal.ts
@@ -79,7 +79,7 @@ export type DateFields = DateKeys|'duration';
type StartUpdate = { startDate:string };
type EndUpdate = { dueDate:string };
-type DurationUpdate = { duration:string };
+type DurationUpdate = { duration:string|number };
type DateUpdate = { date:string };
export type FieldUpdates =
(StartUpdate&EndUpdate)
@@ -289,9 +289,9 @@ export class MultiDateModalComponent extends OpModalComponent implements AfterVi
this.initializeDatepicker();
- // Resent the current start and end dates so duration can be calculated again.
- if (!!this.dates.start && !!this.dates.end) {
- this.dateUpdates$.next({ startDate: this.dates.start, dueDate: this.dates.end });
+ // Resent the current start and duration so that the end date is calculated
+ if (!!this.dates.start && !!this.duration) {
+ this.dateUpdates$.next({ startDate: this.dates.start, duration: this.durationAsIso8601 });
}
this.cdRef.detectChanges();