From cb4dafa71128b42913d3e8b51df438b6826f058b Mon Sep 17 00:00:00 2001 From: Jan Sandbrink Date: Mon, 9 Feb 2015 09:11:15 +0100 Subject: [PATCH] format duration using the DateTimeFormatter fixes failing specs (and failing code for that matter) --- lib/open_project/costs/engine.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/open_project/costs/engine.rb b/lib/open_project/costs/engine.rb index 6bfb6aba80..697c98df19 100644 --- a/lib/open_project/costs/engine.rb +++ b/lib/open_project/costs/engine.rb @@ -140,7 +140,10 @@ module OpenProject::Costs if: -> (*) { costs_enabled && current_user_allowed_to_view_summarized_cost_entries } property :spent_time, - getter: -> (*) { Duration.new(hours_and_minutes(represented.spent_hours)).iso8601 }, + getter: -> (*) do + formatter = API::V3::Utilities::DateTimeFormatter + formatter.format_duration_from_hours(represented.spent_hours) + end, writeable: false, exec_context: :decorator, if: -> (_) { user_has_time_entry_permissions? }