summaryrefslogtreecommitdiffstats
path: root/app/helpers
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2015-03-07 08:12:08 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2015-03-07 08:12:08 +0000
commitf821eaf7221ca05e86efb49d25ac7e3a236e63f7 (patch)
tree5e2df87496f4f3a5a55f133f1d5a4245e6927e35 /app/helpers
parent2800598832d238dcdca3a31da7be940cff8a7d60 (diff)
downloadredmine-f821eaf7221ca05e86efb49d25ac7e3a236e63f7.tar.gz
redmine-f821eaf7221ca05e86efb49d25ac7e3a236e63f7.zip
Adds the date format for ambiguous dates (#19243).
git-svn-id: http://svn.redmine.org/redmine/trunk@14048 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/settings_helper.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/helpers/settings_helper.rb b/app/helpers/settings_helper.rb
index 778abc795..fcf8ec2e3 100644
--- a/app/helpers/settings_helper.rb
+++ b/app/helpers/settings_helper.rb
@@ -125,4 +125,15 @@ module SettingsHelper
options.map {|label, value| [l(label), value.to_s]}
end
+
+ # Returns the options for the date_format setting
+ def date_format_setting_options(locale)
+ Setting::DATE_FORMATS.map do |f|
+ today = ::I18n.l(Date.today, :locale => locale, :format => f)
+ format = f.gsub('%', '').gsub(/[dmY]/) do
+ {'d' => 'dd', 'm' => 'mm', 'Y' => 'yyyy'}[$&]
+ end
+ ["#{today} (#{format})", f]
+ end
+ end
end