Adds the date format for ambiguous dates (#19243).

git-svn-id: http://svn.redmine.org/redmine/trunk@14048 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2015-03-07 08:12:08 +00:00
parent 2800598832
commit f821eaf722
3 changed files with 43 additions and 1 deletions

View File

@@ -124,5 +124,16 @@ 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