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

render chronic duration in input field so that input does not suddenly change

Klaus Zandersb7c2c23979b8
diff --git a/modules/costs/app/components/time_entries/time_entry_form.rb b/modules/costs/app/components/time_entries/time_entry_form.rb
index 74b0dcd0ca8..2e76e20851b 100644
--- a/modules/costs/app/components/time_entries/time_entry_form.rb
+++ b/modules/costs/app/components/time_entries/time_entry_form.rb
@@ -57,6 +57,7 @@ module TimeEntries
f.text_field name: :hours,
required: true,
label: TimeEntry.human_attribute_name(:hours),
+ value: ChronicDuration.output(model.hours * 3600, format: :hours_only),
data: { "time-entry-target" => "hoursInput",
"action" => "blur->time-entry#hoursChanged keypress.enter->time-entry#hoursKeyEnterPress" }