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

Unset duration if it comes back as 0

Oliver Güntherbf466484cb1e
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 f264f411bf4..e9e19d56ca8 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
@@ -618,11 +618,16 @@ export class MultiDateModalComponent extends OpModalComponent implements AfterVi
/**
* Updates the duration property and the displayed value
- * @param value
+ * @param value a ISO8601 duration string or null
* @private
*/
- private setDurationDaysFromUpstream(value:string) {
- const durationDays = this.timezoneService.toDays(value);
- this.updateDuration(durationDays);
+ private setDurationDaysFromUpstream(value:string|null) {
+ const durationDays = value ? this.timezoneService.toDays(value) : null;
+
+ if (durationDays !== null && durationDays > 0) {
+ this.updateDuration(durationDays);
+ } else {
+ this.duration = null;
+ }
}
}