summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorEric Davis <edavis@littlestreamsoftware.com>2010-04-16 15:33:55 +0000
committerEric Davis <edavis@littlestreamsoftware.com>2010-04-16 15:33:55 +0000
commitd22723ed04297175a22b75fec806fa6a1734f299 (patch)
tree49e026955ddb7660577f3fcecbbcbe67917b4e6f /lib
parent88db9d0bdc9b3b91766582e40c4b44627f594f07 (diff)
downloadredmine-d22723ed04297175a22b75fec806fa6a1734f299.tar.gz
redmine-d22723ed04297175a22b75fec806fa6a1734f299.zip
Refactor: Move method
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3673 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib')
-rw-r--r--lib/redmine/custom_field_format.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/redmine/custom_field_format.rb b/lib/redmine/custom_field_format.rb
index 6d42dfba6..29d82b446 100644
--- a/lib/redmine/custom_field_format.rb
+++ b/lib/redmine/custom_field_format.rb
@@ -61,6 +61,18 @@ module Redmine
[ l(custom_field_format.label), custom_field_format.name ]
}
end
+
+ def format_value(value, field_format)
+ return "" unless value && !value.empty?
+ case field_format
+ when "date"
+ begin; format_date(value.to_date); rescue; value end
+ when "bool"
+ l(value == "1" ? :general_text_Yes : :general_text_No)
+ else
+ value
+ end
+ end
end
end
end