diff --git a/app/views/users/settings/account/preferences/index.html.erb b/app/views/users/settings/account/preferences/index.html.erb
index af29ed0c8..d59c8ac09 100644
--- a/app/views/users/settings/account/preferences/index.html.erb
+++ b/app/views/users/settings/account/preferences/index.html.erb
@@ -31,7 +31,7 @@
<%= 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]
diff --git a/lib/i18n/custom_i18n_backend.rb b/lib/i18n/custom_i18n_backend.rb
index d7253f5ec..9b476f2a7 100644
--- a/lib/i18n/custom_i18n_backend.rb
+++ b/lib/i18n/custom_i18n_backend.rb
@@ -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