mirror of
https://github.com/redmine/redmine.git
synced 2025-11-12 00:06:01 +01:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user