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

treat number strings ending with . uniformely in the DurationConverter

ulferts005e39147980
diff --git a/app/services/duration_converter.rb b/app/services/duration_converter.rb
index c16c3b58b0b..65b023af851 100644
--- a/app/services/duration_converter.rb
+++ b/app/services/duration_converter.rb
@@ -111,7 +111,9 @@ class DurationConverter
def parseable?(duration_string)
if number = Integer(duration_string, 10, exception: false) || Float(duration_string, exception: false)
- number >= 0
+ # ruby 3.4 started being able to parse strings like "1." as 1.0.
+ # However, that does not work with ChronicDuration.
+ number >= 0 && !duration_string.ends_with?(".")
else
begin
do_parse(duration_string)