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

Do not put 0h in the time input when there is none

Klaus Zanders6310e478e440
diff --git a/frontend/src/stimulus/controllers/dynamic/time-entry.controller.ts b/frontend/src/stimulus/controllers/dynamic/time-entry.controller.ts
index aaa05e598a7..2e531ad4b17 100644
--- a/frontend/src/stimulus/controllers/dynamic/time-entry.controller.ts
+++ b/frontend/src/stimulus/controllers/dynamic/time-entry.controller.ts
@@ -171,6 +171,12 @@ export default class TimeEntryController extends Controller {
// Parse input through our chronic duration parser and then reformat as hours that can be nicely parsed on the
// backend
const hours = this.parsedHourInput();
+
+ if (hours === 0) {
+ this.hoursInputTarget.value = '';
+ return;
+ }
+
this.hoursInputTarget.value = outputChronicDuration(hours, { format: 'hours_only' }) || '';
this.datesChanged(this.hoursInputTarget);