]> source.dussan.org Git - redmine.git/commitdiff
Merged r9387 from trunk.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 14 Apr 2012 04:53:47 +0000 (04:53 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 14 Apr 2012 04:53:47 +0000 (04:53 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/1.4-stable@9401 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/redmine/core_ext/string/conversions.rb
test/unit/time_entry_test.rb

index 6d9d507314b48f0f9128c4d33c66c282fd6c6f21..3001904e19c9791c01d289cb49c360df69a43299 100644 (file)
@@ -30,7 +30,7 @@ module Redmine #:nodoc:
             # 2:30 => 2.5
             s.gsub!(%r{^(\d+):(\d+)$}) { $1.to_i + $2.to_i / 60.0 }
             # 2h30, 2h, 30m => 2.5, 2, 0.5
-            s.gsub!(%r{^((\d+)\s*(h|hours?))?\s*((\d+)\s*(m|min)?)?$}) { |m| ($1 || $4) ? ($2.to_i + $5.to_i / 60.0) : m[0] }
+            s.gsub!(%r{^((\d+)\s*(h|hours?))?\s*((\d+)\s*(m|min)?)?$}i) { |m| ($1 || $4) ? ($2.to_i + $5.to_i / 60.0) : m[0] }
           end
           # 2,5 => 2.5
           s.gsub!(',', '.')
index ddef645bb7421c5454a9ad6561304426a8aaadc0..3bc1f8f56fd5efd4b030e6e647bf7e73c5fb4e8e 100644 (file)
@@ -45,6 +45,7 @@ class TimeEntryTest < ActiveSupport::TestCase
                    "3 h 15 m" => 3.25,
                    "3 hours"  => 3.0,
                    "12min"    => 0.2,
+                   "12 Min"    => 0.2,
                   }
 
     assertions.each do |k, v|