diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2020-11-15 12:37:17 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2020-11-15 12:37:17 +0000 |
commit | eee1c99a0a71a94e0c6f60d997be60e42bf11aca (patch) | |
tree | 9b24f2329aaebaac163076c3d9b480fc2aead31c /lib/redmine | |
parent | 3247ca8136c32b3da98a04e755443c3ef03bdeaf (diff) | |
download | redmine-eee1c99a0a71a94e0c6f60d997be60e42bf11aca.tar.gz redmine-eee1c99a0a71a94e0c6f60d997be60e42bf11aca.zip |
remove spaces inside {} of lib/redmine/core_ext/string/conversions.rb
git-svn-id: http://svn.redmine.org/redmine/trunk@20387 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib/redmine')
-rw-r--r-- | lib/redmine/core_ext/string/conversions.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/redmine/core_ext/string/conversions.rb b/lib/redmine/core_ext/string/conversions.rb index c52b334e4..d125448bd 100644 --- a/lib/redmine/core_ext/string/conversions.rb +++ b/lib/redmine/core_ext/string/conversions.rb @@ -33,9 +33,9 @@ module Redmine s = $1 else # 2:30 => 2.5 - s.gsub!(%r{^(\d+):(\d+)$}) { $1.to_i + $2.to_i / 60.0 } + 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)?)?$}i) { |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.tr!(',', '.') |