diff options
author | Fabian Schneider <fabbbbbi+git@googlemail.com> | 2018-11-13 19:38:26 +0100 |
---|---|---|
committer | Fabian Schneider <fabbbbbi+git@googlemail.com> | 2019-02-06 17:33:57 +0100 |
commit | 8fabc92e8b4779030c4fa09d8e1c72f213814787 (patch) | |
tree | d79ecbda0b0b5a2814379d83edb4f2395182526c /app/helpers/preferences_helper.rb | |
parent | 5402f3c360eaa668782d53cdf04fcc1cb0a400ec (diff) | |
download | gitlab-ce-8fabc92e8b4779030c4fa09d8e1c72f213814787.tar.gz |
Add helpers for first day of the week
Diffstat (limited to 'app/helpers/preferences_helper.rb')
-rw-r--r-- | app/helpers/preferences_helper.rb | 17 |
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 |