Fix user preferences date format selector [SCI-5815]

This commit is contained in:
Oleksii Kriuchykhin 2021-06-15 11:15:46 +02:00
parent b7513c6d5f
commit b132a13698
2 changed files with 2 additions and 2 deletions

View file

@ -31,7 +31,7 @@
<div class="date-format-selector-container">
<%= select_tag "date-format-input-field",
options_for_select(
Constants::SUPPORTED_DATE_FORMATS.uniq.map{ |df|
Constants::SUPPORTED_DATE_FORMATS.map { |df|
["#{l(Time.new(2019, 11, 25), format: :full_date, date_format: df)}", df]
},
@user.settings[:date_format]

View file

@ -14,7 +14,7 @@ class CustomI18nBackend < I18n::Backend::Simple
end
def localize(locale, object, format = :default, options = {})
options[:date_format] = date_format
options[:date_format] ||= date_format
super(locale, object, format, options)
end
end