Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabian Schneider <fabbbbbi+git@googlemail.com>2018-11-13 21:38:26 +0300
committerFabian Schneider <fabbbbbi+git@googlemail.com>2019-02-06 19:33:57 +0300
commit8fabc92e8b4779030c4fa09d8e1c72f213814787 (patch)
treed79ecbda0b0b5a2814379d83edb4f2395182526c /app/helpers/preferences_helper.rb
parent5402f3c360eaa668782d53cdf04fcc1cb0a400ec (diff)
Add helpers for first day of the week
Diffstat (limited to 'app/helpers/preferences_helper.rb')
-rw-r--r--app/helpers/preferences_helper.rb17
1 files changed, 10 insertions, 7 deletions
diff --git a/app/helpers/preferences_helper.rb b/app/helpers/preferences_helper.rb
index 3371592a36a..0faa28581cc 100644
--- a/app/helpers/preferences_helper.rb
+++ b/app/helpers/preferences_helper.rb
@@ -43,18 +43,21 @@ module PreferencesHelper
]
end
- def default_first_day_of_week
- Date::DAYNAMES[Gitlab::CurrentSettings.default_first_day_of_week]
- end
-
def first_day_of_week_choices
[
- ["System Default (#{default_first_day_of_week})", nil],
- ['Sunday', 0],
- ['Monday', 1]
+ [_('Sunday'), 0],
+ [_('Monday'), 1]
]
end
+ def default_first_day_of_week
+ first_day_of_week_choices.rassoc(Gitlab::CurrentSettings.default_first_day_of_week).first
+ end
+
+ def first_day_of_week_choices_with_default
+ first_day_of_week_choices.unshift([_('System Default (%{default})') % { default: default_first_day_of_week }, nil])
+ end
+
def user_application_theme
@user_application_theme ||= Gitlab::Themes.for_user(current_user).css_class
end