mirror of
https://github.com/meineerde/redmine.git
synced 2025-12-21 16:01:14 +00:00
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
This commit is contained in:
parent
3247ca8136
commit
eee1c99a0a
@ -33,9 +33,9 @@ module Redmine
|
|||||||
s = $1
|
s = $1
|
||||||
else
|
else
|
||||||
# 2:30 => 2.5
|
# 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
|
# 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
|
end
|
||||||
# 2,5 => 2.5
|
# 2,5 => 2.5
|
||||||
s.tr!(',', '.')
|
s.tr!(',', '.')
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user