summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabian Schneider <fabbbbbi+git@googlemail.com>2018-11-08 17:49:54 +0100
committerFabian Schneider <fabbbbbi+git@googlemail.com>2019-02-06 17:33:57 +0100
commit5402f3c360eaa668782d53cdf04fcc1cb0a400ec (patch)
treea6d8baf2283139613178fbb9f3274f1e4cbc0cf5
parent27f7771ae1a4b5f9d973a55ccbbbe30b0e05f100 (diff)
downloadgitlab-ce-5402f3c360eaa668782d53cdf04fcc1cb0a400ec.tar.gz
Add default setting for first day of the week preference
-rw-r--r--app/helpers/preferences_helper.rb5
-rw-r--r--app/views/profiles/preferences/show.html.haml2
-rw-r--r--doc/user/profile/preferences.md3
3 files changed, 8 insertions, 2 deletions
diff --git a/app/helpers/preferences_helper.rb b/app/helpers/preferences_helper.rb
index 301608175b2..3371592a36a 100644
--- a/app/helpers/preferences_helper.rb
+++ b/app/helpers/preferences_helper.rb
@@ -43,8 +43,13 @@ 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]
]
diff --git a/app/views/profiles/preferences/show.html.haml b/app/views/profiles/preferences/show.html.haml
index 5e1c1f30ca4..bed9aa05224 100644
--- a/app/views/profiles/preferences/show.html.haml
+++ b/app/views/profiles/preferences/show.html.haml
@@ -75,7 +75,7 @@
.form-group
= f.label :first_day_of_week, class: 'label-bold' do
First day of the week
- = f.select :first_day_of_week, options_for_select(first_day_of_week_choices, @user.first_day_of_week || Gitlab::CurrentSettings.default_first_day_of_week), {}, class: 'form-control'
+ = f.select :first_day_of_week, first_day_of_week_choices, {}, class: 'form-control'
.form-text.text-muted
Choose on what day the week should start.
.form-group
diff --git a/doc/user/profile/preferences.md b/doc/user/profile/preferences.md
index c14dbe586c4..925bbc84d85 100644
--- a/doc/user/profile/preferences.md
+++ b/doc/user/profile/preferences.md
@@ -94,4 +94,5 @@ This following setting allows you to customize calendar layouts.
### First day of the week
-You can choose between **Sunday** and **Monday** for the first day of the week. This will be used for all calendar views and datepickers.
+You can choose between **Default**, **Sunday** and **Monday** for the first day of the week. If you select **Default**, the system-wide default setting will be used.
+This preference will be used for all calendar views and datepickers.