Commit 5402f3c3 authored by Fabian Schneider's avatar Fabian Schneider

Add default setting for first day of the week preference

parent 27f7771a
...@@ -43,8 +43,13 @@ module PreferencesHelper ...@@ -43,8 +43,13 @@ module PreferencesHelper
] ]
end end
def default_first_day_of_week
Date::DAYNAMES[Gitlab::CurrentSettings.default_first_day_of_week]
end
def first_day_of_week_choices def first_day_of_week_choices
[ [
["System Default (#{default_first_day_of_week})", nil],
['Sunday', 0], ['Sunday', 0],
['Monday', 1] ['Monday', 1]
] ]
......
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
.form-group .form-group
= f.label :first_day_of_week, class: 'label-bold' do = f.label :first_day_of_week, class: 'label-bold' do
First day of the week 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 .form-text.text-muted
Choose on what day the week should start. Choose on what day the week should start.
.form-group .form-group
......
...@@ -94,4 +94,5 @@ This following setting allows you to customize calendar layouts. ...@@ -94,4 +94,5 @@ This following setting allows you to customize calendar layouts.
### First day of the week ### 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.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment